18

After installing Firefox Developer Edition using the Aurora PPA method on 16.04 I dragged the icon from Activities to the launcher sidebar for handy access. But when I click that I get a 2nd firefox icon appear in the sidebar:

screenshot

And every time I click the icon I added I get a new window. How can I get it to behave normally (i.e. when clicked it would display an already running firefox, or if there isn't one, start one)?

4 Answers 4

28

My solution is to edit the firefox-dev.desktop file, adding --class firefox-aurora to the Exec command and StartupWMClass=firefox-aurora as a new line.

The advantage of this one is that Firefox and Firefox Developer Edition will no longer share one icon if both are installed. If you name the class firefox-aurora the separate Firefox icon survives a restart e.g. after an upgrade.

If you have enabled Wayland support by setting env MOZ_ENABLE_WAYLAND=1 you also need to set MOZ_APP_REMOTINGNAME=firefox-aurora and add --name firefox-aurora to the Exec command.

A complete example:

[Desktop Entry]
Encoding=UTF-8
Name=Firefox Developer Edition
GenericName=Developer Web Browser
Comment=Browse the World Wide Web
Type=Application
Terminal=false
Exec=env MOZ_USE_XINPUT2=1 MOZ_ENABLE_WAYLAND=1 MOZ_APP_REMOTINGNAME=firefox-aurora /home/user/Applications/firefox-developer-edition/firefox --class firefox-aurora --name firefox-aurora %U
Icon=/home/user/Applications/firefox-developer-edition/browser/chrome/icons/default/default128.png
Path=/home/user/Applications/firefox-developer-edition
StartupWMClass=firefox-aurora
StartupNotify=true
Categories=Network;WebBrowser;Developer;
3
  • 1
    This is a great solution, particularly when you've got Developer Edition installed locally, you just need to create ~/.local/share/applications/firefox-dev.desktop and it can happily co-exist with the system-installed Firefox stable.
    – hackel
    Apr 10, 2017 at 23:43
  • I've been having problems separating my Firefox icons in Ubuntu 18.04 and this fixed it.
    – Daniel
    Jul 4, 2018 at 15:23
  • 1
    In my case I also had to change the default StartupWMClass=navigator to StartupWMClass=firefox so it wouldn't also override my custom profile icon. That's because when you set --class my-class WM_CLASS becomes navigator my-class instead of navigator firefox. So navigator applies to all, but firefox is just the default.
    – geekley
    Oct 18, 2023 at 19:24
12

The WM_CLASS property of the window "Firefox-dev" doesn't match the file name of the .desktop file. You can check the WM_CLASS property using xprop and click on the opened Firefox's window.

So, here is what I did to make it work :

sudo ln -s /usr/share/applications/firefox.desktop /usr/share/applications/firefox-dev.desktop

Then you can add the new firefox-dev.desktop entry as favorite in you gnome-shell, and it will work.

Cheers !

2
  • Brilliant! I'm testing that out with some other awkward apps, too! Many thanks Dec 15, 2016 at 13:44
  • 1
    Thanks, in my case WM_CLASS is WM_CLASS(STRING) = "Navigator", "Firefox Developer Edition" so the icon name for me worked as "/usr/share/applications/Firefox Developer Edition.desktop" and it seems to have stopped the icon duplication, for example, on session restore
    – JorgeeFG
    May 7, 2019 at 16:14
9
  1. Launch Firefox Development Edition.
  2. Open up the terminal and run xprop WM_CLASS. A + pointer will appear, Click anywhere on the Firefox Development Edition window.
  3. You'll get some output like WM_CLASS(STRING) = "Navigator", "Firefox Development Edition". Choose one of the classes, eg. Firefox Development Edition
  4. Add the class as the value of StartupWMClass in the .desktop file present in ~/.local/share/applications/firefox_dev.desktop . For example, StartupWMClass=Firefox Development Edition. Don't forget to replace firefox_dev with the filename you have for your Firefox Development Edition.
  5. Save the .desktop file, close the application and re-open it. There should now only be 1 icon in the launcher
0

Using Ubuntu 20.04 - here is what I did to fix this issue in my case - Firefox Developer Edition.

  1. Entered this command in my terminal xprop -name "{{window_name}}".

    {{window_name}} was Firefox Developer Edition.

  2. Noted down the class name given on the line WM_CLASS(STRING) = "Navigator", "{{class_name}}".

    {{class_name}} was Firefox Developer Edition.

  3. Changed this line Exec=/opt/firefox/firefox to Exec=/opt/firefox/firefox --class "{{class_name}}" and added this line StartupWMClass={{class_name}} at the end of the {{application.desktop}} file

    {{application.desktop}} was located at /home/{{user}}/.local/share/applications/firefoxDeveloperEdition.desktop, substituted {{class_name}} with value found in previous steps and {{user}} with my user.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .