6

I use latest KDE neon, but I believe the problem regards not exactly KDE but Ubuntu.

When I install flatpak or snap applications KDE doesn't see them - I mean I can't find them in list of applications in the application launcher.

I made some research and I found out that both snaps and flatpak have the following dirs where they keep launchers:

for flatpak its: /var/lib/flatpak/exports/share

for snaps its: /var/lib/snapd/desktop

And I figured out that the system searches for applications in dirs defined in the variable: XDG_DATA_DIRS

So when I execute echo $XDG_DATA_DIRS I get: /usr/share//usr/share/xsessions/plasma:/usr/local/share/:/usr/share/ So it doesn't contain folders with launchers of snaps and flatpak.

What's more, I can see there are suitable scripts in the /etc/profile.d/ that should update this variable, for instance: /etc/profile.d/flatpak.sh has the following content:

# /etc/profile.d/flatpak.sh - set XDG_DATA_DIRS

if [ "${XDG_DATA_DIRS#*flatpak}" = "${XDG_DATA_DIRS}" ]; then
    XDG_DATA_DIRS="${XDG_DATA_HOME:-"$HOME/.local/share"}/flatpak/exports/share:/var/lib/flatpak/exports/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
fi

export XDG_DATA_DIRS

So I guess maybe these scripts for some reason are not executed or they are wrong? Can you guys tell me what is wrong?

3 Answers3

4

Regarding the snap issue, if you're using zsh you might be hitting this snap bug.

A workaround is to explicitly source /etc/profile.d/apps-bin-path.sh in your .zshrc or .zshenv.

Kevin Bowen
  • 20,055
  • 57
  • 82
  • 84
1

A workaround is to manually make a starter that runs /snap/bin/[your_app_name]

See Add a menu item to KDE Launcher how to do that.

Sandro L
  • 131
0

Did you reboot? Or you can just log out and log in.

I've just installed flatpak and found myself in the same situation: /etc/profile.d/flatpak.sh is there but it didn't have a chance to run since it wasn't there during the startup. And the script needs to be run at startup since "the path needs to be added to this variable before your desktop manager is started".

user
  • 473