Add a profile script for Fish

Technically, Fish users can already make this work using
https://github.com/edc/bass, but it's also nice to have this working on
an out-of-the-box Flatpak installation.

Fixes #3109.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
This commit is contained in:
Ryan Gonzalez
2021-11-13 17:17:14 -06:00
committed by Alexander Larsson
parent 86d6918a11
commit d37c739f6c
2 changed files with 21 additions and 0 deletions

View File

@@ -162,6 +162,10 @@ profiledir = $(PROFILE_DIR)
profile_DATA = profile/flatpak.sh
EXTRA_DIST += $(profile_DATA)
fishconfdir = $(sysconfdir)/fish/conf.d
fishconf_DATA = profile/flatpak.fish
EXTRA_DIST += $(fishconf_DATA)
envdir = $(datadir)/gdm/env.d
env_DATA =
if INSTALL_GDM_ENV_FILE

17
profile/flatpak.fish Normal file
View File

@@ -0,0 +1,17 @@
if type -q flatpak
# Set XDG_DATA_DIRS to include Flatpak installations
set -x --path XDG_DATA_DIRS
set -q XDG_DATA_DIRS[1]; or set XDG_DATA_DIRS /usr/local/share /usr/share
set -q XDG_DATA_HOME; or set -l XDG_DATA_HOME $HOME/.local/share
set -l installations $XDG_DATA_HOME/flatpak
begin
set -le G_MESSAGES_DEBUG
set -lx GIO_USE_VFS local
set installations $installations (flatpak --installations)
end
set XDG_DATA_DIRS {$installations}/exports/share $XDG_DATA_DIRS
end