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.