Skip to content

Instantly share code, notes, and snippets.

@Postrediori
Last active June 8, 2024 18:41
Show Gist options
  • Save Postrediori/9f1a5e1fa27df656838f33e3c4b5776f to your computer and use it in GitHub Desktop.
Save Postrediori/9f1a5e1fa27df656838f33e3c4b5776f to your computer and use it in GitHub Desktop.
Fix Wayland icons of apps after switching to KDE & Wayland [Ubuntu 24.04]

Fix Wayland icons of apps after switching to KDE & Wayland [Ubuntu 24.04]

Description

After switching to Wayland some apps have default Wayland icon:

Default icons screenshot

Example setup for Firefox

The solution is to setup proper .desktop file name for windows of these apps.

  1. Find the proper name of Firefox .desktop file:
$ find ~ -iname *firefox*.desktop

~/.local/share/applications/firefox_firefox.desktop
  1. Setup KDE window rule.

Open System Settings -> Window Management -> Window Rules.

Click + Add New... and set the parameters:

  • Window class (application) -> Exact Match, enter firefox
  • Match whole window class -> Yes
  • Click + Add Property... -> Select Desktop file name and enter name of .desktop file, e.g. firefox_firefox.desktop in the example above.

Setup screenshot

Alternatvelly one can use the WaylandDesktopFile.kwinrule file provided. In the Window Rules dialog click Import... and set the actual .desktop file name afterwards.

Links

[Firefox icon]
Description=Firefox icon
desktopfile=firefox_firefox.desktop
desktopfilerule=3
wmclass=firefox
wmclasscomplete=true
wmclassmatch=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment