diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-09 10:19:46 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-09 10:19:46 +0900 |
| commit | b9d337f3c0ca2501744a1bb12b9bd6d3929c692c (patch) | |
| tree | dd312fea6046764464b93cb3464b9b260bb3062f /dmenu/dmenu_path_desktop | |
| parent | 0bbc6ee96491c8f9619148018214427d8ca026b4 (diff) | |
updates
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 |
