summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/guiscripts/dmdsktp16
1 files changed, 14 insertions, 2 deletions
diff --git a/bin/guiscripts/dmdsktp b/bin/guiscripts/dmdsktp
index 3711f13..a48aca6 100755
--- a/bin/guiscripts/dmdsktp
+++ b/bin/guiscripts/dmdsktp
@@ -1,9 +1,21 @@
#!/bin/sh
# Searches through .desktop files and prompt to launch them via dmenu
-gtk-launch "$(find ~/.local/share/applications \
+if [ "$MENUCMD" = "tofi" ]
+then
+ menucmd="tofi"
+elif [ "$MENUCMD" = "dmenu" ]
+then
+ menucmd="dmenu -g 1 -i"
+else
+ menucmd="fzf"
+fi
+
+choice="$(find ~/.local/share/applications \
-maxdepth 1 \
-type f \
-not -iname "wine-extension*" -a -iname "*.desktop" \
-printf "%f\n" |
cut -d. -f1 |
- dmenu -i -p "app:" -g 1)"
+ $menucmd)"
+test -z "$choice" && exit 1
+gtk-launch "$choice"