I recently faced an issue with Fish shell for not having direct access to flatpak apps in the menu. It is termed a non-POSIX shell. Can someone tell me the difference between having the non-POSIX shell and a regular one?
I just want a good-looking shell with auto-completion features that makes my terminal experience easier and it should not cause any issues like as in fish.
The issue isn’t with running flatpaks. It is with them being added to the menu in certain DEs.
The code that does that by default is in a shell script in /etc/profile.d which fish doesn’t source.
If you use one of those DEs, you need to either not have fish as your default shell or replicate those changes in fish.
In general, I, personally think it is bad idea to set a non-POSIX compliant shell as your default shell. flatpak isn’t the only piece of software that has this problem. By setting a POSIX compliant shell as your default and then setting fish as the default shell in your terminal, you get all the benefits of fish without the side-effects.
Yeah, but wouldn’t you just copy those scripts to /etc/fish/conf.d or reflink them there?
I have installed flatpaks both before and after starting to use fish as a shell, and they all work, have Icons that you click to start, etc… If they aren’t working for @hemanthch then I am suggesting something else is the underlying issue.
You could, after verifying they worked with fish as-is. If not, they may need modification.
Are you also using plasma like he is?
To be clear, I never stated “It is impossible to get this to work with fish as your default shell”. My opinion is if you want things to “just work” without intervention, you are better off having your default shell be POSIX compliant even if you use a different shell for your interactive sessions.
To be clear, I never had to do anything other than install fish as my shell to “get it to work”. It works, at least out of the box on Gnome, I don’t use KDE, and haven’t since well a really long time, so I cannot speak to that.
The flatpak package includes this script as `/etc/profile.d/flatpak.sh:
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"
GIO_USE_VFS=local 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
This is needed on plasma for flatpaks to be available in the menu. If it isn’t needed on gnome, that is fine but that doesn’t really relate to the OP’s issue.
Fish uses XDG_DATA_DIRS just like any other shell, if Plasma is having difficulty with flatpaks and fish, then I am saying it is an issue with plasma, not fish since I didn’t have to do anything special to get it up and running in Gnome, and I would assume if I spin up a KDE VM with Plasma it would work fine too.
zsh Rocks for sure and with Powerline you can have a real cool terminal experience! Glad you like it. Could you mark that comment that led you to try out Powerline as the solution please?