Behavior of $SNAP under KDE Wayland

Issue: The app icon is showing correctly in Application Dashboard and Krunner. But in task switcher the default wayland icon is displayed.

This is the .desktop file:

[Desktop Entry]
Name=Trackself
Comment=Trackself time tracker
Exec=trackself
Icon=${SNAP}/meta/gui/trackself.png
Terminal=false
Type=Application
Categories=Productivity;

If I hardcode the Icon path to /snap/trackself/current/meta/gui/trackself.png then the task switcher can find it too.

Based on this, my novice mind assumes that the issue is in the task switcher not having the $SNAP environment variable set correctly.

Anybody got any suggestions how to work around this problem? Obviously I do not want to hard code the icon path.

1 Like

The true desktop file that’s exposed is in /var/lib/snapd/desktop/applications and the files under that folder have the proper icon paths. I am also not sure what’s the real issue. Looking into this for long now.

I found the root cause. And got a work around. See: GitHub - JanezStupar/SnapcraftFlutterIconTest

Basically, you need to change the APPLICATION_ID in CMakeLists.txt to <appname>_<reverse_domain_id>.

In this example: testapp_com.example.testapp, so that it matches the filename of the desktop file after snapcraft renames it during install.

Yeah, that’s a big complicated issue. But, for starters, firefox, thunderbird and KDE apps have got a patch for it