summaryrefslogtreecommitdiff
path: root/bin/menuscripts
diff options
context:
space:
mode:
Diffstat (limited to 'bin/menuscripts')
-rwxr-xr-xbin/menuscripts/mdsktp21
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/menuscripts/mdsktp b/bin/menuscripts/mdsktp
new file mode 100755
index 0000000..a48aca6
--- /dev/null
+++ b/bin/menuscripts/mdsktp
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Searches through .desktop files and prompt to launch them via dmenu
+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 |
+ $menucmd)"
+test -z "$choice" && exit 1
+gtk-launch "$choice"