Dotfiles config update (2022-05-26)

This commit is contained in:
q3aql 2022-05-26 21:38:45 +02:00
parent 33a28ff753
commit 67f2b640c0
6 changed files with 59 additions and 21 deletions

View File

@ -34,7 +34,7 @@ clean:
dist: clean dist: clean
mkdir -p dmenu-$(VERSION) mkdir -p dmenu-$(VERSION)
cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1\ cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1\
drw.h util.h dmenu_path dmenu_run stest.1 $(SRC)\ drw.h util.h dmenu_drun dmenu_run stest.1 $(SRC)\
dmenu-$(VERSION) dmenu-$(VERSION)
tar -cf dmenu-$(VERSION).tar dmenu-$(VERSION) tar -cf dmenu-$(VERSION).tar dmenu-$(VERSION)
gzip dmenu-$(VERSION).tar gzip dmenu-$(VERSION).tar
@ -42,9 +42,9 @@ dist: clean
install: all install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f dmenu dmenu_path dmenu_run stest $(DESTDIR)$(PREFIX)/bin cp -f dmenu dmenu_drun dmenu_run stest $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_path chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_drun
chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run
chmod 755 $(DESTDIR)$(PREFIX)/bin/stest chmod 755 $(DESTDIR)$(PREFIX)/bin/stest
mkdir -p $(DESTDIR)$(MANPREFIX)/man1 mkdir -p $(DESTDIR)$(MANPREFIX)/man1
@ -55,7 +55,7 @@ install: all
uninstall: uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\ rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\
$(DESTDIR)$(PREFIX)/bin/dmenu_path\ $(DESTDIR)$(PREFIX)/bin/dmenu_drun\
$(DESTDIR)$(PREFIX)/bin/dmenu_run\ $(DESTDIR)$(PREFIX)/bin/dmenu_run\
$(DESTDIR)$(PREFIX)/bin/stest\ $(DESTDIR)$(PREFIX)/bin/stest\
$(DESTDIR)$(MANPREFIX)/man1/dmenu.1\ $(DESTDIR)$(MANPREFIX)/man1/dmenu.1\

38
.config/dmenu/dmenu_drun Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
desktop_files="/usr/share/applications"
desktop_files_home="${HOME}/.local/share/applications"
list_desktop_files() {
if [ -d "${desktop_files}" ] ; then
ls -1 "${desktop_files}"
fi
if [ -d "${desktop_files_home}" ] ; then
ls -1 "${desktop_files_home}"
fi
}
rundesk () {
if [ -z ${1} ] ; then
echo "No file entry"
else
if [ -f "${1}" ] ; then
eval "$(awk -F= '$1=="Exec"{$1=""; print}' "$1")"
else
echo "File does not exist"
fi
fi
}
if [ -f /usr/bin/dex ] ; then
runDesktop="dex"
else
runDesktop="rundesk"
fi
list_output=$(list_desktop_files | dmenu "$@")
if [ -f "${desktop_files}/${list_output}" ] ; then
${runDesktop} "${desktop_files}/${list_output}"
elif [ -f "${desktop_files_home}/${list_output}" ] ; then
${runDesktop} "${desktop_files_home}/${list_output}"
fi

View File

@ -1,13 +0,0 @@
#!/bin/sh
cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
cache="$cachedir/dmenu_run"
[ ! -e "$cachedir" ] && mkdir -p "$cachedir"
IFS=:
if stest -dqr -n "$cache" $PATH; then
stest -flx $PATH | sort -u | tee "$cache"
else
cat "$cache"
fi

View File

@ -1,2 +1,15 @@
#!/bin/sh #!/bin/sh
dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} &
dmenu_path_output() {
cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
cache="$cachedir/dmenu_run"
[ ! -e "$cachedir" ] && mkdir -p "$cachedir"
IFS=:
if stest -dqr -n "$cache" $PATH; then
stest -flx $PATH | sort -u | tee "$cache"
else
cat "$cache"
fi
}
dmenu_path_output | dmenu "$@" | ${SHELL:-"/bin/sh"} &

View File

@ -71,7 +71,7 @@ static const Layout layouts[] = {
/* commands */ /* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; static const char *dmenucmd[] = { "dmenu_run", NULL };
static const char *termcmd[] = { "st", NULL }; static const char *termcmd[] = { "st", NULL };
#include <X11/XF86keysym.h> #include <X11/XF86keysym.h>

View File

@ -20,7 +20,7 @@ dotfiles - My tiling Qtile, Spectrwm, i3 , Dwm & Sway configurations (for Arch/D
xfce4-screenshooter xscreensaver alsa-utils pulseaudio-alsa light xorg-xbacklight \ xfce4-screenshooter xscreensaver alsa-utils pulseaudio-alsa light xorg-xbacklight \
xorg-xrandr sway swaybg swayidle wofi meson waybar wayland-protocols xorg-xwayland \ xorg-xrandr sway swaybg swayidle wofi meson waybar wayland-protocols xorg-xwayland \
wf-recorder xdg-desktop-portal-wlr wl-clipboard grim slurp jq wlroots pulseaudio \ wf-recorder xdg-desktop-portal-wlr wl-clipboard grim slurp jq wlroots pulseaudio \
alacritty qtile python-pip xorg-xsetroot alacritty qtile python-pip xorg-xsetroot dex
```` ````
```shell ```shell
@ -53,7 +53,7 @@ dotfiles - My tiling Qtile, Spectrwm, i3 , Dwm & Sway configurations (for Arch/D
sway swaybg swayidle wlr-randr wdisplays wofi meson waybar wl-clipboard \ sway swaybg swayidle wlr-randr wdisplays wofi meson waybar wl-clipboard \
wayland-protocols libwlroots6 libcairo2 libpango-1.0-0 libgdk-pixbuf2.0-0 \ wayland-protocols libwlroots6 libcairo2 libpango-1.0-0 libgdk-pixbuf2.0-0 \
libpcre++0v5 libjson-c5 xwayland libwayland-egl1-mesa libwayland-bin \ libpcre++0v5 libjson-c5 xwayland libwayland-egl1-mesa libwayland-bin \
xdg-desktop-portal-wlr wf-recorder weston grim xdg-desktop-portal-wlr wf-recorder weston grim dex
```` ````
```shell ```shell