summaryrefslogtreecommitdiff
path: root/bin/menuscripts/mdsktp
blob: a48aca6f8c5c6404d7c6cf178f3ecb37fce31ad4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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"