diff options
Diffstat (limited to 'profile')
-rw-r--r-- | profile/flatpak.sh.in | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/profile/flatpak.sh.in b/profile/flatpak.sh.in index 8b350e85..6b21aa49 100644 --- a/profile/flatpak.sh.in +++ b/profile/flatpak.sh.in @@ -1,7 +1,15 @@ # @sysconfdir@/profile.d/flatpak.sh - set XDG_DATA_DIRS -if [ "${XDG_DATA_DIRS#*flatpak}" = "${XDG_DATA_DIRS}" ]; then - XDG_DATA_DIRS="${XDG_DATA_HOME:-"$HOME/.local/share"}/flatpak/exports/share:@localstatedir@/lib/flatpak/exports/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" -fi +new_dirs= +while read -r install_path +do + share_path=$install_path/exports/share + case ":$XDG_DATA_DIRS:" in + *":$share_path:"*) :;; + *":$share_path/:"*) :;; + *) new_dirs=${new_dirs:+${new_dirs}:}$share_path;; + esac +done < <(echo "${XDG_DATA_HOME:-"$HOME/.local/share"}/flatpak"; flatpak --installations) export XDG_DATA_DIRS +XDG_DATA_DIRS="${new_dirs:+${new_dirs}:}${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" |