I’m trying to add a launcher for an executable which doesn’t have its own icon when launched on its own. In the .Desktop file I’m setting the icon to use and it shows up correctly, but when I launch it, it just spawns a new entry rather than using the launcher and it also doesn’t have an icon, it just uses some sort of default icon:
I’ve clicked the icon on the left, but as you can see, it is lacking the white bar which indicates that the application is running. Instead a new icon appears (the one on the right) and it doesn’t even use the correct icon.
This is my .Desktop file btw:
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=X-AIR-Edit
Comment=Controller software for digital Behringer mixers
Icon=/home/fedora/bin/X-AIR-Edit_LINUX_1.7/X-AIR-Edit_icon.ico
Exec=/home/fedora/bin/X-AIR-Edit
Terminal=false
Categories=Sound;Media
StartupWMClass=X-AIR-Edit
StartupNotify=true
As you can see I already tried to set StartupWMClass to the WM_Class and Name to the process name, but it’s still not working…
This is how I got the process name and WM_CLASS btw:
This has to match the actual class of the window. In Gnome Shell on Wayland, you can see the class in the looking glass, Windows tab (Alt + F2, lg Enter).
So following your script, my .desktop file should look like this, right?
[Desktop Entry]
Name=X-AIR Edit
Comment=Remote control for Behringer X Air mixers
Icon=/home/fedora/bin/X-AIR-Edit_LINUX_1.7/X-AIR-Edit_icon.ico
Exec=/home/fedora/bin/X-AIR-Edit
Terminal=false
Type=Application
Categories=Audio;Mixer;AudioVideo;
StartupWMClass=X-AIR-Edit
I’m hesitant on actually installing the application into /opt, but I can’t see a reason for why that would make a difference.
Replacing my .desktop file with the above, I still get the same icon behavior.
I’ve tested the above code in a f37 VM and it works just fine.
The Filesystem Hierarchy Standard defines /opt as the appropriate place for third-party add-on software, in accordance with well-established practice since UNIX days.
I don’t recommend editing desktop files manually as it may result in various issues, including the inability to validate file structure and properly update icon and mime caches.