1

In 20.04, I had this working fine using .desktop files like this:

[Desktop Entry]
Version=1.0
Name=Firefox Web Browser (Personal)
Comment=Browse the World Wide Web
GenericName=Web Browser
Keywords=Internet;WWW;Browser;Web;Explorer
Exec=firefox -P Personal --class FirefoxPersonal --no-remote %u
StartupWMClass=FirefoxPersonal
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox
Categories=GNOME;GTK;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;
StartupNotify=true
Actions=new-window;new-private-window;

[Desktop Action new-window] Name=Open a New Window Exec=firefox -new-window -P Personal --class FirefoxPersonal

[Desktop Action new-private-window] Name=Open a New Private Window Exec=firefox -private-window -P Personal --class FirefoxPersonal

I have several other profiles for different purposes. They all use the --class argument to Firefox to add the special WM_CLASS property, and then the .desktop file tells Gnome (presumably) to look for StartupWMClass=.... This worked fine in 20.04.

Now in 22.04, notably with Firefox snap, it does correctly launch with the right profile, and the WM_CLASS property is set to the correct value, but the dock shows a new icon below the dividing line, and if I launch multiple Firefox instances for each profile, they are all grouped under that icon.

If I add that icon to favorites, it loses all information about profiles (it asks at startup) and still groups all the windows together.

I'm wondering if this has to do with the fact that Firefox is running as a snap. Has anyone had this issue and have they found a workaround? All that I can find here and elsewhere is stuff that applies to earlier versions of Ubuntu.

siride
  • 1,123

1 Answers1

1

The workaround was to move from Snap to regular Firefox install. I suspect the issue is that when launched via Snap, the initial WM_CLASS value is something generic (possibly not even Firefox) and then eventually gets changed once the startup gets further along. But GNOME isn't smart enough to deal with this, so it groups the window in the wrong place.

Following the steps in this link worked for me: https://askubuntu.com/a/1403392/906933

siride
  • 1,123