No GUI way to start snap apps in KDE plasma?

This might be because I am just plain stupid, and others in the snap community that I have asked on Twitter have just ignored me, so it might be the case. If so, I deeply apologize in advance.

In KDE Neon with tcsh as shell I have no GUI way to start apps. They do not show up in the plasma menu, nor can I start them via the launcher [Alt]+[F2]. Finally, I have been able to start them via “snap run”, but that feels a bit unintuitive if it is the only way.

So please point me to the simple solution that I have overlooked, or tell me how I can help mend this oversight.

Snapd drops a file at /etc/profile.d/snapd.sh (probably ignored by tcsh) and adds relevant entries for user-session envnrionemnt generators. AFAICT this should work in most cases. Can you run the following commands in a terminal and paste their output:

$ env |grep -e '^PATH=' -e '^XDG_DATA_DIRS='
$ systemctl --user show-environment |grep -e '^PATH=' -e '^XDG_DATA_DIRS='
> env |grep -e '^PATH=' -e '^XDG_DATA_DIRS='
PATH=/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/local/bin:/usr/local/ssl/bin:/usr/local/samba/bin:/usr/local/java/bin:/usr/games
XDG_DATA_DIRS=/usr/share//usr/share/xsessions/plasma:/home/kenneth/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop

> systemctl --user show-environment |grep -e '^PATH=' -e '^XDG_DATA_DIRS='
PATH=/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/local/bin:/usr/local/ssl/bin:/usr/local/samba/bin:/usr/local/java/bin:/usr/games
XDG_DATA_DIRS=/usr/share//usr/share/xsessions/plasma:/home/kenneth/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop

Clearly something is off here. There is an entry in $XDG_DATA_DIRS, but none in $PATH. Can you confirm that /usr/lib/environment.d/990-snapd.conf exists in your system?

Perhaps, there’s something overriding PATH in your environment. Unfortunately there’s many ways in which it could get broken. I would suggest looking at any other scripts in /usr/lib/environment.d that run after 990-snapd.conf, perhaps your profile setup too.

Ah, so it is my system that is wrong. Right. I have only two files in /usr/lib/environment.d/

990-snapd.conf
PATH=$PATH:/snap/bin
XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}:/var/lib/snapd/desktop

and

99-environment.conf -> /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

And without knowing anything about this, I guess that the second file overwrites the first one?

You can run the generator yourself to check how the PATH is assembled like so:

SYSTEMD_LOG_LEVEL=debug /usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator

Hmm, looks correct.

> /usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
XDG_DATA_DIRS=/usr/share//usr/share/xsessions/plasma:/home/kenneth/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop:/var/lib/snapd/desktop

The generator produced this path:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

but your environment has this:

PATH=/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/local/bin:/usr/local/ssl/bin:/usr/local/samba/bin:/usr/local/java/bin:/usr/games

Which is different. There’s probably some other setup code involved, perhaps your user profile or some tcsh profile setup scripts?