diff options
| author | Moritz Meißelbach <arbelzapf@gmail.com> | 2019-11-08 21:22:49 +0100 |
|---|---|---|
| committer | Moritz Meißelbach <arbelzapf@gmail.com> | 2019-11-08 21:22:49 +0100 |
| commit | 9dc1986ab0aa0021d4a2c74e39bd5913a8f7141b (patch) | |
| tree | 9b63ea96eea4476fc3676581d5d31afc75b26946 /sway-launcher-desktop.sh | |
| parent | 628f36f3812bcc9b0e5008f45e3e2bc3831bb489 (diff) | |
| download | sway-launcher-desktop-9dc1986ab0aa0021d4a2c74e39bd5913a8f7141b.tar.gz sway-launcher-desktop-9dc1986ab0aa0021d4a2c74e39bd5913a8f7141b.zip | |
Get locations of desktop application folders according to spec
Diffstat (limited to 'sway-launcher-desktop.sh')
| -rwxr-xr-x | sway-launcher-desktop.sh | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sway-launcher-desktop.sh b/sway-launcher-desktop.sh index 102ab9f..23b11e5 100755 --- a/sway-launcher-desktop.sh +++ b/sway-launcher-desktop.sh @@ -16,12 +16,9 @@ GLYPH_COMMAND=" " GLYPH_DESKTOP=" " HIST_FILE="${XDG_CACHE_HOME:-$HOME/.cache}/${0##*/}-history.txt" -# TODO: Actually follow spec here: https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html -DIRS=( - "$HOME/.local/share/applications" - /usr/local/share/applications - /usr/share/applications -) +# Get locations of desktop application folders according to spec +# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html +IFS=':' read -ra DIRS <<< "${XDG_CONFIG_HOME-${HOME}/.config}:${XDG_DATA_DIRS-/usr/local/share:/usr/share}" function describe() { if [[ $2 == 'command' ]]; then @@ -157,7 +154,7 @@ for i in "${!DIRS[@]}"; do if [[ ! -d "${DIRS[i]}" ]]; then unset -v 'DIRS[$i]' else - DIRS[$i]="${DIRS[i]}/**/*.desktop" + DIRS[$i]="${DIRS[i]}/applications/**/*.desktop" fi done # shellcheck disable=SC2068 |
