Created
June 7, 2019 18:35
-
-
Save rosstimson/0d45ea7dd1528167550656079a7000fc to your computer and use it in GitHub Desktop.
/etc/profile.d/flatpak.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if command -v flatpak > /dev/null; then | |
# set XDG_DATA_DIRS to include Flatpak installations | |
new_dirs=$( | |
( | |
unset G_MESSAGES_DEBUG | |
echo "${XDG_DATA_HOME:-"$HOME/.local/share"}/flatpak" | |
flatpak --installations | |
) | ( | |
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 "$new_dirs" | |
) | |
) | |
export XDG_DATA_DIRS | |
XDG_DATA_DIRS="${new_dirs:+${new_dirs}:}${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment