DEV Community

Cover image for Two Of The Same Blue Firefox Developer Edition Icons On My Dock! WTH?
B. Burt
B. Burt

Posted on

Two Of The Same Blue Firefox Developer Edition Icons On My Dock! WTH?

Recently, I ran into some issues trying to install Firefox Developer Edition and so I'm writing this in the hopes that I can save somebody some trouble.

My issues were that A) I didn't know how to go from a folder in my Downloads directory to a working browser, and B) after I got the browser installed, I had a dumb icon for it, the system default icon instead of the nice blue firefox logo icon.

Oh, and also, I just remembered, I HAD TWO OF THE SAME ICON!!

After I got the right icon showing up, I'd close the browser, there'd be the one icon on my dock, because I had pinned it there. If I fired up Firefox Developer Edition, there'd be a second blue icon on my dock. And that bugged me.

But we can fix it with a .desktop file.

You can get the Firefox Developer Edition browser from the Mozilla website, which I did.

And we're left with a compressed archive in our downloads directory. In my case (I'm on Linux) it's called 'firefox-108.0b1.tar.bz2'.

Ok. Now what?

Let's right-click on it, and select "Extract Here" from the dropdown.

Now we have a folder named: "firefox-108.ob1", that's not a browser! lol.

So the next move is to try something different.

The first time I went through this, a while back, I found a forum thread on this topic on Ask Ubuntu, here.

Recently I've been reading How Linux Works, 3rd Edition by Brian Ward and I had just read the section about dealing with compressed files. So let's try working with this file from the command line.

I learned that there's actually two steps involved here, decompressing and then unpacking. and you want to work from left to right (you can do it in one step but I want to do them separately). And the order is important.

First we use the bzip2 tool and give it the name of the file, run:

bunzip2 firefox-108.0b1.tar.bz2

to decompress it. Now I'm left with 'firefox-108.0b1.tar', minus the 'bz2' at the end. So that worked.

Now let's check the contents with the 'table-of-contents' mode by running:

tar -tvf firefox-108.0b1.tar

With that command, I can see that I'm not going to be left with a mess of files everywhere in my Downloads directory because I can see the directory structure, everything will be in a firefox folder.

So let's run the same command, except switch the -t for an -x, and throw in a -p, like this:

tar -xpvf firefox-108.0b1.tar

The -p is for preserve permissions (not sure if it's needed, but I included it to be safe), the -x is for extract, the -v is for verbose mode, and the -f is for file.

Then delete the .tar file.

Now I'm left with a folder named firefox. That's not a browser! lol. Now what?

That forum thread I mentioned earlier, the Ask Ubuntu forum, suggested an alternative method with a tool called Ubuntu Make. Here's Ubuntu Make's GitHUb.

To install Ubuntu Make:

snap install ubuntu-make --classic

Or better yet:

sudo add-apt-repository ppa:lyzardking/ubuntu-make

and then:

sudo apt-get update

and finally:

sudo apt-get ubuntu-make

After installing Ubuntu Make, you can run:

umake web firefox-dev

Another solution, and this is the one that I used this time because it's just cool is a Bash script to do all the work for you. It is from tanrax on GitHub here.

Run this command using curl and piped into Bash:

curl -s -L linux-install-firefox-developer-edition https://raw.githubusercontent.com/tanrax/linux-install-firefox-developer-edition/main/linux-install-firefox-developer-edition | bash

This command fetches the script from his GitHub repository, then runs it. It even keeps you posted on it's progress in the terminal. Pretty cool, huh?

Here's the entire script:

#!/bin/bash

# START
set -e

## UNINSTALL
# Remove binaries
sudo rm -rf /opt/firefox-developer/ /usr/bin/firefox-developer

# DOWNLOAD
curl -L -o firefox-developer.tar.bz2 https://download.mozilla.org/\?product\=firefox-devedition-latest-ssl\&os\=linux64\&lang\=en-US

# EXTRACT
tar -xf firefox-developer.tar.bz2
rm -rf firefox-developer.tar.bz2
mv firefox firefox-developer

# INSTALL
sudo mv firefox-developer /opt
sudo ln -s /opt/firefox-developer/firefox /usr/bin/firefox-developer

# DESKTOP INTEGRATION
echo -e "[Desktop Entry]\nEncoding=UTF-8\nName=Firefox Developer Edition\nComment=Firefox Developer Edition\nExec=/opt/firefox-developer/firefox %u\nTerminal=false\nIcon=/opt/firefox-developer/browser/chrome/icons/default/default128.png\nStartupWMClass=Firefox Developer\nType=Application\nCategories=Network;WebBrowser;\nMimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;x-scheme-handler/http;x-scheme-handler/https;\nStartupNotify=true\n" | sudo tee -a /usr/share/applications/firefox-developer.desktop

# NOTIFY
echo "Installed!"

Enter fullscreen mode Exit fullscreen mode

The issue with the two icons, that I ran into in the past has something to do with a file that has a .desktop file extension.

Here's an example:

[Desktop Entry]
Name=Firefox Developer 
GenericName=Firefox Developer Edition
Exec=/opt/firefox_dev/firefox %u
Terminal=false
Icon=/opt/firefox_dev/browser/chrome/icons/default/default128.png
Type=Application
Categories=Application;Network;X-Developer;
Comment=Firefox Developer Edition Web Browser.
StartupWMClass=Firefox Developer Edition
Enter fullscreen mode Exit fullscreen mode

You can find these in your /usr/share/applications/ directory.

You can see that in the example above, the icons are in /opt/firefox_dev/browser/chrome/icons/default/. You can look for your icons there.

If the "Icon" line in your .desktop file says something different than where you found your icons, then change that line to where you found your icons.

I ran this command:

xprop WM_CLASS

which will turn your pointer or cursor into a little crosshairs thing. Move the crosshairs onto (anywhere on top of) your Firefox Developer browser window and click. Displayed in your terminal will be the WM_CLASS (whatever that is). My output said: '"Navigator", "firefox"'.

And so I changed the line on my firefox-dev.desktop file, the line that says 'StartupWMClass' (the last line in the example above), I changed it to "Navigator", "firefox". I think I even threw in an "aurora" in there for good measure, lol. And that fixed my issue with the two icons.

Using that script from tanrax, I didn't have that issue.

Try running: xprop by itself and then clicking on your browser window. The output in your terminal has a lot more info for you. HaHa, even some pictures of the logo.

Top comments (0)