Fish (friendly interactive shell) users find themselves losing their installed snapd/flatpak apps after restarting the desktop.
These apps can be run with respective commands. However, they are unable to be found at the desktop menu. They cannot associate default apps either.
If you are also a fish user, when you run flatpak update
, you get this:
Note that the directories
'/var/lib/flatpak/exports/share'
'/home/[username]/.local/share/flatpak/exports/share'
are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.
Then you try running echo $XDG_DATA_DIRS
, you get an empty string.
These flatpak apps are not in the PATH env, and this is the main reason that these installed apps disappear.
Why it is not loaded? Because fish does not (and cannot) load /etc/profile
. This a crucial step to add those paths to the env and let desktop know where the flatpak/snapd apps are installed.
-
Install
fisher
, the plugin manager for fish. -
Install a plugin called
bass
, which can be used to "source" a sh file.
fisher install edc/bass
(we need this plugin because we cannot do fish bash source xxx
, because that way it will throw an error: bash: source: no such file or directory
)
- Create or edit the existing file
~/.config/fish/config.fish
, add the following line and save.
bass source /etc/profile
- Log out log in, or restart you computer. You can see those apps are back.