diff options
Diffstat (limited to 'dmenu/dmenu_path_desktop')
| -rwxr-xr-x | dmenu/dmenu_path_desktop | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/dmenu/dmenu_path_desktop b/dmenu/dmenu_path_desktop new file mode 100755 index 0000000..5ff74b3 --- /dev/null +++ b/dmenu/dmenu_path_desktop @@ -0,0 +1,18 @@ +#!/bin/sh + +cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}" +cache="$cachedir/dmenu_run_desktop" + +[ ! -e "$cachedir" ] && mkdir -p "$cachedir" + +dirs="" +IFS=: +for dir in "${XDG_DATA_DIRS:-"/usr/local/share:/usr/share"}"; do + dirs="${dirs}:${dir}/applications" +done; + +if stest -dqr -n "$cache" $PATH; then + stest -fl $dirs | grep -v 'mimeinfo.cache' | sed 's/\.[^./]*$//' | sort -u | tee "$cache" +else + cat "$cache" +fi |
