13

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
  • 67,112
  • 21
  • 233
  • 243
dln949
  • 1,185
  • 5
  • 15
  • 29

2 Answers2

16

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
grisfer
  • 517
  • 4
  • 8
  • 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](https://bugs.chromium.org/p/chromium/issues/detail?id=118613) suggests that gnome is not honoring the `--class` option – JellicleCat 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
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
  • 809
  • 7
  • 18