Software launcher issue | StartupWMClass

Hi, I have a problem with SW launcher integration with two internet browsers. The Ungoogled-chromium and Iridium browser.
I have a xfce desktop and Fedora40.
When I open Ungoogled-chromium in whisker menu it opens and opens as a Ungoogled chromium (on the panel theres a Ungoogled-chromium’s launcher with its Icon). When I open Iridium browser in whisker menu, it opens, but it opens also as Ungoogled-chromium (on the panel theres a Ungoogled-chromium’s launcher with its icon). So basicly when I open them both, it shows on panel like there are two windows of Ungoogled-chromium
obrazek
insted of one of Ungoogled-chromium and one of Iridium browser.
Also when I open Iridium browser only and right-click on the launcher on panel, click on edit launcher, its completly a Ungoogled-chromium’s launcher.

I tried to make my own launcher in /home/username/.local/share/applications/iridium.desktop
I used other launchers as an example.

[Desktop Entry]
Name=IridiumBrowser
Comment=Iridium chromium based web browser
GenericName=Web Browser
Exec=/usr/bin/iridium-browser %U
Icon=iridium-browser
Type=Application
Categories=Network;WebBrowser;
Path=

But it did not work, maybe because I did it wrong, after all I do not have much experience.

I did not find much on the internet, because I do not much know what to search for.

So If you have some expirience, I’d be glad If you’d share them.

This is because both these browsers produce windows with the same WMClass. The desktop environment thus cannot tell them apart.

2 Likes

Thank you very much, now I know where is the problem. However now I have problem with solution.
I tried to change StartupWMClass in .desktop file to StartupWMClass=iridium
but well that does nothing

Also the xprop WM_CLASS command showed different class than the one in .desktop file so something renames it after startup

The only thing that quite helped me
I used xdotool to search for id of the window
then I edited it by force with

xprop -id 94371843 -f WM_CLASS 8s -set WM_CLASS "Iridium"

that changed it until I closed the window. I know that I could do some script that would force it that way, but I belive that there would be more wise solution.

Do you know how to properly edit it, because I could not find any normal solution on internet. Even chat gpt didn’t much helped with it.

It is at the level of one of the browsers that you need to change the WMClass of the windows it produces. Then you have to tell in the corresponding .desktop launchers what that WMClass is. I am not familiar with the browsers, so I cannot tell how you can change their WMClass. That typically is a command line option.

1 Like

well yes, but how do I change the WMClass, in the .desktop file theres a StartupWMClass=
but that don’t change it (maybe yes but then somewhat rewrites it).
I’m only able to add another layer that will rewrite it after being rewriten by writing some script that chatgpt recommended me. But I’m asking some more wise solution like removing that 2nd layer that renames it, but anyways I’m gonna write iridium devs, because It’s them having bad WMCLass. I just want to know how do I change the WMClass.

That is where you will need to do some research. I already hinted to you that there likely will be a command line option. There, you define what the WMCLass should be called. You then refer to that name in your .desktop launcher.

thank you, but I think it’s so complicated that I no longer want to use iridium. But hey, thank you.

1 Like

It is not really that complicated :grinning:. Vladislav Grigoryev automates, and yes, the script looks complicated. But this is really the only things you need to do:

Edit your iridium.desktop launcher and

  1. add the command line option --class=iridium-browser. This way, you tell Iridium it should create windows with class “iridium-browser”. The Exec= line becomes:
    Exec=/usr/bin/iridium-browser %U
    
  2. Then you tell the desktop environment which windows to associate with the current launcher by adding the StartupWMClass line:
    StartupWMClass=iridium
    
1 Like

As you said, I edited the Exec= and now it works. Thank you.