summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-20 21:34:59 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-20 21:35:07 +0200
commit2758227472054a0976d8dc0888da9aff83031eec (patch)
tree8d725a013751a929f61bcce71d9fab6f5cd5f469
parent448d79700296d8b1e61c976321ea1b7d6061b5ec (diff)
made dmdsktp MENUCMD sensible
-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"