Configuring the GNOME Shell Panel with Firefox and Thunderbird Profiles
Mozilla’s Firefox web browser and Thunderbird e-mail clients have a little-known feature known as “Profiles.” Profiles allow you to create fully separate instances of these applications, each with their own customized config preferences and extensions.
I make heavy use of this feature to create separate Firefox profiles for my personal everyday web browser, work web browser, web development browser, etc. With Thunderbird, I use profiles to separate my personal vs. work email.
From the command line, invoking firefox
or thunderbird
with the -P
option will bring up a dialog box, allowing you to chose between your existing profiles, or create/rename/delete profiles:
If you haven’t created any new profiles, you’ll be using a profile named default. On my Ubuntu systems, each of these profiles will be stored under your ~/.mozilla/firefox/
directory (for Firefox) or ~/.thunderbird/
directory (for Thunderbird).
If you want to be able to easily launch these profiles from the GNOME Shell GUI rather than the command line, you can create custom launchers for each profile. I typically do this and choose different icons for each profile to visually tell them apart. To do this, create a .desktop file within your ~/.local/share/applications/
directory. I typically name these files firefox-<profile-name>.desktop. Here’s an example of one:
[Desktop Entry]
Version=1.0
Name=Firefox (WebDev)
Exec=firefox -P webdev -no-remote --class FirefoxWebDev
Comment=firefox
Terminal=false
Icon=/usr/share/icons/oxygen/base/128x128/categories/applications-development-web.png
Type=Application
StartupWMClass=FirefoxWebDev
By default, the Icon setting will search for an icon file (e.g, .svg or .png file) from your current theme within your /usr/share/icons/
directory. Specify an absolute path to the icon file and include its filename extension if you want to use an icon that’s not in your current theme. You can also create custom icons and drop them in your ~/.local/share/icons/
directory.
Note that on the Exec line I’m also starting firefox with two additional options, -no-remote
and --class
. The -no-remote
option prevents conflicts with other instances of Firefox that are running. The --class
option specifies a window manager class, which you’ll also set for the StartupWMClass option. You can set this value to any string you like, but it must be unique (i.e, don’t re-use it in another .desktop launcher config).
If you don’t set a custom window manager class, all of your running profiles will be grouped together under the same icon in the GNOME Shell panel. That last subtlety has been an annoyance I’ve wanted to fix for a long time, and learning about it is what prompted me to write this post to share.
References: Mozilla docs on using the profile manager, AskUbuntu post on setting the window manager class
- firefox , linux , productivity , ubuntu , useful tips
- Comments(2)
September 8th, 2024 at 3:23 am
StartupWMClass doesn’t seem to work as of September 2024. Should be noted, I’m using Fedora 40 Atomic, and firefox is a flatpak. All my firefox icons are still grouped. Pity, I found this annoying too.
September 10th, 2024 at 2:56 pm
Thanks for mentioning this. Are you using Wayland? I’m sticking with Xorg for the time being, but at one point I was experimenting with Wayland and I found I had to change `–class` to `–name` in the Exec to get the same behavior. And I believe I also needed to prefix the command with `env MOZ_ENABLE_WAYLAND=1`, though I vaguely recall that might be the default in more recent versions of Firefox. If that fixes things for you, let me know and I’ll update the blog post.