diff --git a/.config/dmenu/Makefile b/.config/dmenu/Makefile index a03a95c..b2db8b7 100644 --- a/.config/dmenu/Makefile +++ b/.config/dmenu/Makefile @@ -34,7 +34,7 @@ clean: dist: clean mkdir -p dmenu-$(VERSION) 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) tar -cf dmenu-$(VERSION).tar dmenu-$(VERSION) gzip dmenu-$(VERSION).tar @@ -42,9 +42,9 @@ dist: clean install: all 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_path + chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_drun chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run chmod 755 $(DESTDIR)$(PREFIX)/bin/stest mkdir -p $(DESTDIR)$(MANPREFIX)/man1 @@ -55,7 +55,7 @@ install: all uninstall: rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\ - $(DESTDIR)$(PREFIX)/bin/dmenu_path\ + $(DESTDIR)$(PREFIX)/bin/dmenu_drun\ $(DESTDIR)$(PREFIX)/bin/dmenu_run\ $(DESTDIR)$(PREFIX)/bin/stest\ $(DESTDIR)$(MANPREFIX)/man1/dmenu.1\ diff --git a/.config/dmenu/dmenu_drun b/.config/dmenu/dmenu_drun new file mode 100755 index 0000000..fad5709 --- /dev/null +++ b/.config/dmenu/dmenu_drun @@ -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 diff --git a/.config/dmenu/dmenu_path b/.config/dmenu/dmenu_path deleted file mode 100755 index 3a7cda7..0000000 --- a/.config/dmenu/dmenu_path +++ /dev/null @@ -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 diff --git a/.config/dmenu/dmenu_run b/.config/dmenu/dmenu_run index 834ede5..9f6d0c4 100755 --- a/.config/dmenu/dmenu_run +++ b/.config/dmenu/dmenu_run @@ -1,2 +1,15 @@ #!/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"} & diff --git a/.config/dwm/config.h b/.config/dwm/config.h index 70d2bea..cb9db27 100644 --- a/.config/dwm/config.h +++ b/.config/dwm/config.h @@ -71,7 +71,7 @@ static const Layout layouts[] = { /* commands */ 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 }; #include diff --git a/Dependencies.md b/Dependencies.md index 19f7d9b..018ed18 100644 --- a/Dependencies.md +++ b/Dependencies.md @@ -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 \ 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 \ - alacritty qtile python-pip xorg-xsetroot + alacritty qtile python-pip xorg-xsetroot dex ```` ```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 \ wayland-protocols libwlroots6 libcairo2 libpango-1.0-0 libgdk-pixbuf2.0-0 \ 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