From 9dc1986ab0aa0021d4a2c74e39bd5913a8f7141b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Fri, 8 Nov 2019 21:22:49 +0100 Subject: Get locations of desktop application folders according to spec --- sway-launcher-desktop.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'sway-launcher-desktop.sh') 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 -- cgit v1.2.3