Snap/Core24: Desktop Files and Desktop Environment integration (Generic Icons on taskbar and/or frame)

Author: whitenoisedevCreated Sep 3, 2026Updated Sep 3, 2026

I am working with Obsidian (the markdown editor). Recently, we have revamped our snap taking advantage of the new core24 pipeline of electron-builder. This has solved some long standing issues, however we have noticed new ones.

This thread is specifically about snaps and their integration with desktop environments under Wayland (which is enabled by default since circa Electron 38).

The setup

  1. desktopName, Wayland’s app_id are set tomd.obsidian.Obsidian (following the convention of using FQDN), StartupWMClass is also set to md.obsidian.Obsidian within the .desktop file.
  2. The snap produced by electron-builder (v26, syncDesktopName=true) has a template meta/gui/md.obsidian.Obsidian.desktop within the .snap. (NOTE: There is a separate issue that two desktop files are created see here)
  3. When the snap is installed, it (snapd?) creates /var/lib/snapd/desktop/applications/obsidian_md.obsidian.Obsidian.desktop (from meta/gui/md.obsidian.Obsidian.desktop).

The problem (Generic Wayland icon)

The observed behavior when running Obsidian on (K)Ubuntu 26.04:

  • GNOME: Icon in taskbar is generic wayland icon, icon in application switcher (alt-tab) is generic wayland
  • KDE: Icon in taskbar in correct, icon in application frame and in the application switcher (alt-tab) is generic Wayland (See this KDE-BR-466599)
  • XFCE: users also report problems, but I haven't tested.

What window managers expect

  • If I manually rename /var/lib/snapd/desktop/applications/obsidian_md.obsidian.Obsidian.desktop to obsidian_obsidian.desktop Gnome works, but KDE still has the same problems.
  • If I manually rename /var/lib/snapd/desktop/applications/obsidian_md.obsidian.Obsidian.desktop to md.obsidian.Obsidian.desktop everything works everywhere.

Why the problem specifically with Snaps

It seems that snapd creates .desktop files in /var/lib/snapd/desktop/applications/ using the pattern {snapname}-{originaldesktopfile}.desktop. All other package formats we support (deb, flatpak) install a md.obsidian.Obsidian.desktop and that works everywhere.

The Solution?

I hope my understanding of the problem is correct. I am not sure what the solution to this problem is. Specifically, I am not sure:

  1. If electron-builder should do something special while building the snap OR
  2. If this is something that snapd should handle with some manipulation at installation time OR
  3. If desktop environments have to become "snap" aware in their search for a match, that is the DE also searches for obsidian-md.obsidian.Obsidian.desktop.

Link to SnapCraft forum topic.

Source: electron-userland/electron-builder