summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Gonzalez <ryan.gonzalez@collabora.com>2021-11-13 17:17:14 -0600
committerAlexander Larsson <alexander.larsson@gmail.com>2021-11-15 10:44:55 +0100
commitd37c739f6cdda3d269ea7c7b630c18fc154bb971 (patch)
tree118dfce8f7be85ba9e3ffa64c4da5df6a9a52646
parent86d6918a1186467fb4e26408ec1bb947dcf7ba28 (diff)
downloadflatpak-d37c739f6cdda3d269ea7c7b630c18fc154bb971.tar.gz
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>
-rw-r--r--Makefile.am4
-rw-r--r--profile/flatpak.fish17
2 files changed, 21 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index ba29a0c4..43b05b22 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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
diff --git a/profile/flatpak.fish b/profile/flatpak.fish
new file mode 100644
index 00000000..e78244a4
--- /dev/null
+++ b/profile/flatpak.fish
@@ -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