16

Ubuntu 17.10 (xorg), GNOME 3.26.2, Firefox 58.0 (64 bit).

I have a few Firefox profiles setup. When I run each profile, I would like it to be a separate icon on the dock. How do I make that happen? Right now what happens is that they are all grouped in the standard Firefox icon.

pomsky
  • 70,797
dln949
  • 1,345

3 Answers3

17

Edit profile's .desktop file:

The string SomeClass must be the same in both changes.

Example .desktop file:

[Desktop Entry]
Name=Firefox Test
Exec=firefox -p test -no-remote --class FxTest
Terminal=false
Type=Application
StartupNotify=true
Icon=/path/to/custom/icon.png
StartupWMClass=FxTest

Added in 2022
For Snapped Firefox you can try Parallel Installs:

  1. sudo snap set system experimental.parallel-instances=true
  2. reboot
  3. sudo snap install firefox_parallel --unaliased
  4. cp /var/lib/snapd/desktop/applications/firefox+parallel_firefox.desktop ~/.local/share/applications/
  5. gedit ~/.local/share/applications/firefox+parallel_firefox.desktop

For Wayland, use --name SomeClass. Like --class, --name is defined by GTK and is not documented by Firefox.

grisfer
  • 535
  • grisfer, this answer appears to work for the question I asked, so thank you. However..... While I do now have distinct icons on the dock, they are all the official Firefox icon, and not the icon I specified in the desktop file. (I realize that is not part of my original question.) – dln949 Jul 13 '18 at 00:45
  • 1
    Did you add both changes (--class SomeClass and StartupWMClass=SomeClass)? If only the first, then the icons will be distinct, but with the standard image. Also, the string SomeClass must be the same in both changes. If the strings are different then icons will be with the standard image. – grisfer Jul 13 '18 at 11:25
  • I added both, using the exact same string. Result was it used the Firefox icon, not the icon I specified. – dln949 Jul 13 '18 at 17:29
  • 1
    Unfortunately, I don't know. It works for me (I have a custom icon). – grisfer Jul 13 '18 at 21:16
  • 1
    This bug suggests that gnome is not honoring the --class option – Jellicle Nov 30 '18 at 20:31
  • @JellicleCat Indeed, this does not work for me on Gnome 3.30. Thanks for pointing to the bugreport. – vanadium Dec 01 '18 at 12:15
  • 1
    This works for me on KDE Plasma 5. – MountainX Dec 03 '18 at 03:41
  • The .desktop file gets the custom icon, but when it is launched, the default icon appears – Vitor Abella Jan 31 '25 at 16:33
  • it didnt work for ubuntu 22.04 – Vitor Abella Feb 01 '25 at 13:39
0

Copy the firefox icon file.

cp /usr/share/applications/firefox.desktop \
   /usr/share/applications/firefox-dev.desktop

In the new file edit 4 lines, using the full path for the executable and icon. The icon shown below is a blue colored version of the firefox icon.

[Desktop Entry]
...
Exec=/opt/firefox-dev/firefox
Icon=/opt/firefox-dev/browser/chrome/icons/default/default128.png
...
[Desktop Action new-window]
...
Exec=/opt/firefox-dev/firefox -new-window
...
[Desktop Action new-private-window]
...
Exec=/opt/firefox-dev/firefox -private-window

Then follow the instructions here to put the new icon file in the gnome registry.

sudo apt install dconf-editor
dconf-editor

Navigate to org.gnome.shell favorite-apps and add in your new icon

[ ..., 'firefox.desktop', 'firefox-dev.desktop', ... ]

It may necessary to log out and log back in before using the icon.

Craig Hicks
  • 849
  • 9
  • 20
0

Worked on Ubuntu 22.04

The only way I managed to make 2 independently firefox shortcuts in the dock (one of them with different icon), where its windows are gathered with its corresponding icon, was to install a deb firefox along with the snap firefox.

##########################
#Disable snap firefox
sudo snap disable firefox
sudo apt remove --autoremove firefox -y

########################## #Install .deb firefox sudo add-apt-repository ppa:mozillateam/ppa -y sudo apt-get update -y sudo apt-get upgrade -y #Set firefox updates priority for the .deb repository sudo bash -c 'cat > /etc/apt/preferences.d/99mozillateamppa <<EOF Package: firefox* Pin: release o=LP-PPA-mozillateam Pin-Priority: 501

Package: firefox* Pin: release o=Ubuntu Pin-Priority: -1 EOF' sudo apt install -t 'o=LP-PPA-mozillateam' firefox -y #the deb is installed in /usr/lib/firefox

###########################

enable snap firefox again

sudo snap enable firefox #########################

change firefox icon

old="Icon=firefox" new="Icon=/path/to/your/icon" sudo sed -i "/${old}/c ${new}" /usr/share/applications/firefox.desktop

#change .deb firefox name old="Name=Firefox Web Browser" new="Name=FirefoxSecond" sudo sed -i "/${old}/c ${new}" /usr/share/applications/firefox.desktop

To open firefoxSecond (.deb) :

firefox

To open firefox( snap) :

snap run firefox

Now add them to favorites!

Vitor Abella
  • 8,055