I'm using Ubuntu 22.04 with the KDE Plasma desktop environment. I downloaded the Obsidian personal wiki as an AppImage, and I added a Menu item for it and created a .desktop
file in ~/.local/share/applications/
.
When creating the Menu item, I added the Obsidian logo as the application's icon. In the menu and in the taskbar, Obsidian shows with this icon. In the Alt+Tab task switcher, however, it shows up as what I assume is a "placeholder" icon of a grey square with a black "X" that has a yellow/orange equatorial ring around it.
If I right-click the application in the Menu and select "Edit Application", the icon selection widget shows the correct icon. The .desktop
file has this line to define the icon:
Icon=/home/username/icons/Obsidian.png
I'm certain this line is correct because if I change it to anything else (like Icon=~/icons/Obsidian.png
, for instance), then the Menu no longer shows the icon for Obsidian (it just has a blank space instead). For some reason, however, the task switcher isn't picking up the icon from that file.
I'm using the "MediumDefault" task switcher. How do I configure it to use the correct icon file for a given application?
Edit: More
Following @vanadium's answer, I found xprop
was the only tool they mentioned that I already had. I used it to find WM_CLASS(STRING) = "obsidian", "obsidian"
. (To use it, run xprop
in the terminal and then click on the window whose info you want).
In ~/.local/share/applications/Obsidian.desktop
I added a StartupWMClass
line to the end and then tried each of these forms for it in turn:
- StartupWMClass="obsidian", "obsidian"
- StartupWMClass="obsidian"
- StartupWMClass=obsidian
None of them caused the Obsidian icon to replace the placeholder icon in the task switcher after saving the file, however.