A quick post to share how I set up custom Firefox profiles in the GNOME Shell favourites menu (or variously called a dash or dock). Copying a .desktop file is quite simple, but the tips here will give you:

  • A separate icon
  • A separate WMClass so that each copy of Firefox is seen as independent by GNOME shell (open window indicator, application switching)
  • A free icon 😁

The primary motivation was keeping LastPass installed on the Work profile, and Bitwarden in the Personal profile, as well as the option to run different extensions in different situations.

Create a Profile

$ firefox --ProfileManager
The Firefox profile manager with the Create, Rename, and Delete Profile options

Keep the "Use the selected profile without asking at startup" option checked, so you don't get prompted each time.

Copy the firefox.desktop / firefox-wayland.desktop file

I use Firefox on Wayland, so adjust for your setup.

$ sudo -i
# cd /usr/share/applications
# cp firefox-wayland.deskop firefox-work.desktop

Modify Exec

Replace the --name, add the -P (profile) flag with your profile name, and add a suitable --class:

- Exec=firefox-wayland --name firefox-wayland %u
+ Exec=firefox-wayland --name firefox-work -P Work --class FirefoxWork %u

Add StartupWMClass

Add a matching StartupWMClass setting so the window manager knows which one to look for:

+ StartupWMClass=FirefoxWork

Modify Icon

Copy the Firefox icon, and update the Icon field to match (otherwise it'll get very confusing). I've adapted this briefcase icon from the Noun Project on Wikimedia Commons:

A firefox icon with a small white briefcase in the lower-right corner

The original icon was located at /usr/share/icons/hicolor/256x256/apps/firefox-work.png. I didn't copy the 64x64 or other sizes, because they don't get used on my desktop.

Enjoy!

Here it is on my desktop, with the shiny little work icon, and the all the correct behaviour you'd expect (run them side by side and the icons will turn blue and switch correctly).

A screenshot showing two Firefox icons - one default, and one with a small briefcase and a different name