• We did not send an email asking for donations - please read this post.

How To Add Firefox to the Dash to Dock in Gnome SOLVED

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,386
Reaction score
1,164
Credits
12,524
I'm running Debian 11 Gnome on a 64-bit desktop: Asus Tuf Gaming-
Runs great-

The Firefox ESR that came with Debian was slow out dated(91.0) so I removed it from my system.

Downloading the newest version of FF was a breeze however; the only way I can launch is to go to the Downloads directory open the Firefox file and than double click on the FF icon to launch the browser.

How would I add Firefox to my Dash to Dock in Gnome?
 
Last edited:


Tolkem

Well-Known Member
Joined
Jan 6, 2019
Messages
1,472
Reaction score
1,195
Credits
10,700
I'm running Debian 11 Gnome
Gnome is a pain in this scenario. Plus Debian's 11 older version 3.38, don't think help much either. I use Firefox beta, so I download the tarball from Mozilla's website, and then add it to my system. In KDE Plasma it's very easy using the built in tool; kmenuedit. Which you could try and install, since
Description-en: XDG menu editor. This package provides a menu editor which may be used to edit the KDE Plasma workspaces menu or any other XDG menu.
If I understand correctly the above description, it seems it might work in other DEs, not only plasma. You could also try menulibre and see if that helps. Or, you could create a Firefox.desktop file, place it in ~/.local/share/applications, or /usr/share/applications and see if that works. https://freedesktop.org/wiki/Howto_desktop_files/
Hope this helps! :)

EDIT: Just found this https://tools51.nasqueron.org/generators/GNOME/desktop-file no idea whether it works, but might be worth a try.
 
Last edited:
OP
Alexzee

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,386
Reaction score
1,164
Credits
12,524
Thanks for the quick reply.

I'll make a FF desktop file and move it to /usr/share/applications and see if that works.

Well I created a Firefox.desktop file and moved it to /usr/share/applications.
I'm not sure how to launch FF from there, any ideas?
 
Last edited:

Tolkem

Well-Known Member
Joined
Jan 6, 2019
Messages
1,472
Reaction score
1,195
Credits
10,700
Thanks for the quick reply.

I'll make a FF desktop file and move it to /usr/share/applications and see if that works.
IF that fails I'll give menulibre a try.
Remember to give the full path for the icon, which is /path/to/firefox/chrome/browser/default/default48.png Also, it's advisable to place/install pkgs you download as a tarball to /opt. So, you could do
Bash:
sudo mv /path/to/firefox /opt
and then in the Firefox.desktop file, where it reads Exec= put Exec=/opt/firefox/firefox and do the same for the icon Icon=/opt/firefox/chrome/browser/default/default48.png
You could use this one https://github.com/srevinsaju/Firefox-Appimage/blob/master/desktop/firefox.desktop download and edit appropriately to reflect your system's info; paths and everything else.
 
OP
Alexzee

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,386
Reaction score
1,164
Credits
12,524
Remember to give the full path for the icon, which is /path/to/firefox/chrome/browser/default/default48.png Also, it's advisable to place/install pkgs you download as a tarball to /opt. So, you could do
Bash:
sudo mv /path/to/firefox /opt
and then in the Firefox.desktop file, where it reads Exec= put Exec=/opt/firefox/firefox and do the same for the icon Icon=/opt/firefox/chrome/browser/default/default48.png
You could use this one https://github.com/srevinsaju/Firefox-Appimage/blob/master/desktop/firefox.desktop download and edit appropriately to reflect your system's info; paths and everything else.
I'm going to have to edit the Firefox.desktop file I made as the Exec argument I have is not what you have.
 
OP
Alexzee

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,386
Reaction score
1,164
Credits
12,524
I fixed the Firefox.desktop file and moved it to /opt.
Now how would I add it to the Dash to Dock or how would I launch FF now?
 
OP
Alexzee

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,386
Reaction score
1,164
Credits
12,524
I couldn't launch FF so I had to move the FF icon that I moved to /opt back into the Downloads directory.

If it helps here's the full path to the firefox folder and icon:
/home/cora/Downloads/firefox/firefox
 

Tolkem

Well-Known Member
Joined
Jan 6, 2019
Messages
1,472
Reaction score
1,195
Credits
10,700
I fixed the Firefox.desktop file and moved it to /opt.
Now how would I add it to the Dash to Dock or how would I launch FF now?
You could try logout and log in back, and see if that works. That's why I said "Gnome is a pain in this scenario.", because in every other desktop I've tried, this method simply works. That being said, there's another approach you could try. Launch a terminal and run
Code:
sudo ln -sf /home/cora/Downloads/firefox/firefox /usr/bin/firefox
this will create a symlink to Firefox's executable in /usr/bin/ then, modify the Exec line in the .desktop file to Exec=/usr/bin/firefox then try searching for it in Gnome. Again, convention is that foreign pkgs should be placed in /opt, to avoid accidentally move or delete it, thus making it unusable. https://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/opt.html
 
OP
Alexzee

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,386
Reaction score
1,164
Credits
12,524
You could try logout and log in back, and see if that works. That's why I said "Gnome is a pain in this scenario.", because in every other desktop I've tried, this method simply works. That being said, there's another approach you could try. Launch a terminal and run
Code:
sudo ln -sf /home/cora/Downloads/firefox/firefox /usr/bin/firefox
this will create a symlink to Firefox's executable in /usr/bin/ then, modify the Exec line in the .desktop file to Exec=/usr/bin/firefox then try searching for it in Gnome. Again, convention is that foreign pkgs should be placed in /opt, to avoid accidentally move or delete it, thus making it unusable. https://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/opt.html
Logging out and than logging back in didn't help.
Running the cmd to create a symlink and editing the Firefox.desktop and changing the Exec argument didn't help either.
After looking in the Software Menu menulibre wasn't available and I didn't want to manually install it.

***I have to agree with you that Gnome is a pain in this case.***
Launching Firefox from my Downloads directory works so I will make do with that.

Thanks for your time and the link to the Gnome desktop file generator.
 

Tolkem

Well-Known Member
Joined
Jan 6, 2019
Messages
1,472
Reaction score
1,195
Credits
10,700
OP
Alexzee

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,386
Reaction score
1,164
Credits
12,524
I read through both of those articles, thanks Tolkem.

When time permit's I'll have to read them again and think on it.
 

Tolkem

Well-Known Member
Joined
Jan 6, 2019
Messages
1,472
Reaction score
1,195
Credits
10,700
I found something else https://en.wikibooks.org/wiki/Using_GNOME/Application_menus
And there it says:
The downside is that, for them to appear in the Application menu at all, you must assign them to certain categories and this can only be done by editing the launcher files using a text editor.
And they have an example there, on Firefox:
Code:
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Mozilla Firefox
Comment=Mozilla Firefox Web Browser
Exec=/usr/bin/firefox %U
Icon=firefox-icon.png
Terminal=false
Type=Application
Categories=Application;Network;
GenericName=
Also, I think in Gnome both the launcher and the icon have to have the exact same name; firefox, firefox.png.
 
OP
Alexzee

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,386
Reaction score
1,164
Credits
12,524
I found something else https://en.wikibooks.org/wiki/Using_GNOME/Application_menus
And there it says:

And they have an example there, on Firefox:
Code:
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Mozilla Firefox
Comment=Mozilla Firefox Web Browser
Exec=/usr/bin/firefox %U
Icon=firefox-icon.png
Terminal=false
Type=Application
Categories=Application;Network;
GenericName=
Also, I think in Gnome both the launcher and the icon have to have the exact same name; firefox, firefox.png.
I've got the day off tomorrow and will take a look and go over what you have posted for me.
Thanks!
 
OP
Alexzee

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,386
Reaction score
1,164
Credits
12,524
Before I proceed with the Gnome Applications Folders tutorial, does this (Firefox.desktop file) look right?

Code:
Desktop Entry]
Name=Firefox Browser
StartupWMCClass=Firefox Browser
Comment=Browse With Firefox
GenericName=Web Browser
Exec=/usr/bin/firefox
Icon=/home/cora/Downloads/firefox/firefox/chrome/default/default48.png
Type=Application
Categories-Application;Network;WebBrowser;
MineType=text/html;text/xml;application/xhtml+xml;application/xml;application/v>
Keywords=Firefox;Browse;Internet
StartupWMClass=Firefox Browser
 
OP
Alexzee

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,386
Reaction score
1,164
Credits
12,524
After following the Gento WiKi that you posted for me in thread #10 I still don't have a way to launch FF but to go to the firefox folder and double click on the firefox icon.

Sadly logging out and back in again didn't help.
 

Tolkem

Well-Known Member
Joined
Jan 6, 2019
Messages
1,472
Reaction score
1,195
Credits
10,700
Before I proceed with the Gnome Applications Folders tutorial, does this (Firefox.desktop file) look right?

Code:
Desktop Entry]
Name=Firefox Browser
StartupWMCClass=Firefox Browser
Comment=Browse With Firefox
GenericName=Web Browser
Exec=/usr/bin/firefox
Icon=/home/cora/Downloads/firefox/firefox/chrome/default/default48.png
Type=Application
Categories-Application;Network;WebBrowser;
MineType=text/html;text/xml;application/xhtml+xml;application/xml;application/v>
Keywords=Firefox;Browse;Internet
StartupWMClass=Firefox Browser
Seriously, in any DE I've tried (quite a few ones) this method always works, but not in Gnome. Anyway, I don't know if it's a "mispaste" thing, but the first line Desktop Entry is missing a [, it should look like:
[Desktop Entry]

Try changing that file to:
Code:
[Desktop Entry]
Version=1.0
Name=Firefox
GenericName=Web Browser
Comment=Browse the World Wide Web
Keywords=Internet;WWW;Browser;Web;Explorer;
Exec=/usr/bin/firefox
Icon=/home/cora/Downloads/firefox/firefox/chrome/default/Firefox.png
Terminal=false
X-MultipleArgs=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;application/pdf;application/json;
StartupNotify=true
StartupWMClass=Firefox
Categories=Network;WebBrowser;
Actions=new-window;new-private-window;
Rename the icon to match Firefox's launcher name. Also, launch Firefox and from a terminal run
Code:
xprop | grep CLASS
You'll see an +, click on the Firefox window to get the actual name of the launcher, and use that in the .desktop file. For example, here I get:
Code:
xprop | grep CLASS
WM_CLASS(STRING) = "Navigator", "firefox-beta"
Hope this helps! And you could always change desktop and use KDE (or any other, really) instead to regain full control over these trivial things ;)
 
Last edited:

Tolkem

Well-Known Member
Joined
Jan 6, 2019
Messages
1,472
Reaction score
1,195
Credits
10,700
This works! I downloaded Debian Bullseye Gnome, played a bit with that from a live USB, and managed to get that working.
Bash:
[Desktop Entry]
Version=1.0
Name=Firefox
GenericName=Web Browser
Comment=Browse the World Wide Web
Keywords=Internet;WWW;Browser;Web;Explorer;
Exec=/opt/firefox/firefox/firefox
Icon=/opt/firefox/firefox/browser/chrome/icons/default/firefox.png

Terminal=false
X-MultipleArgs=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;application/pdf;application/json;
StartupNotify=true
StartupWMClass=Navigator
Categories=Network;WebBrowser;
Actions=new-window;new-private-window;
Copy and paste exactly that, don't change anything, not even the empty line (yeah, I'm serious) Move Firefox folder to /opt, and make sure whether the path it's like that, or just /firefox/firefox, since I noticed that when whatever tool gnome uses to extract files, it created the folder firefox-101.0 (which I renamed just firefox) and placed the firefox folder inside that one, so you could also check in your current firefox.desktop file, as the error might be there; the path isn't correct.
1655185358133.png


1655185399623.png


There's one thing I couldn't figure out, tho; in the activities/applications dashboard, firefox's icon doesn't show.

1655185594209.png


By the way, if you haven't already, but want to remove firefox ESR, follow this:
1.
Code:
cd /tmp
2.
Code:
sudo apt install equivs
3.
Code:
touch bogus-browser
Place the following content into bogus-browser file:
Bash:
source: bogus-browser
Section: misc
Priority: optional
Standards-Version: 3.9.2
Package: bogus-browser
Version: 1.0
Maintainer: Your Mom
Provides: firefox, firefox-esr, epiphany
Architecture: all
Description: placeholder yah
4. Then
Code:
equivs-build bogus-browser
5.
Code:
sudo dpkg -i bogus-browser_1.0_all.deb
6.
Code:
sudo apt purge equivs && sudo apt autoremove
7.
Code:
cd
8. Remove firefox ESR
Code:
sudo apt remove --purge firefox-esr
If you wonder why all that, it is because if you try to simply remove without "installing" bogus-browser, apt will try to install epiphany to satisfy some dependency. I had to deal with that when tried Bullseye LXQT, and found those instructions in the old antix forum, thought I have it bookmarked, and if I did, I couldn't find it, luckily, I had copied/pasted to a file and saved for future use. :)
 
Last edited:
OP
Alexzee

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,386
Reaction score
1,164
Credits
12,524
Well, I copied the Desktop Entry and pasted it exactly like you said and moved the FF folder to /opt.
I went to the applications menu and firefox is not there to add to the dock.
The path to Firefox on my system now is /opt/firefox/firefox

You have /opt/firefox/firefox/firefox in the argument in the Desktop Entry like this:
Exec=/opt/firefox/firefox/firefox.

Do I need to make another directory and put the firefox directory in the new directory?


FF in Opt.png


Firefox.desktop file.png
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Top