Two different icons used for Firefox in the bottom panel

Ubuntu 24.04.3 LTS. GNOME Classic.

There are two Firefox binaries in my laptop :

1. /usr/bin/firefox
2. $HOME/tools/firefox/firefox

I installed the second one and it is the one I use always. However, I noticed that whenever I use it, the icon shown for it in the bottom panel of GNOME Classic is not the Firefox icon but the icon used for any executable. If I start /usr/bin/firefox, the bottom panel shows the Firefox icon for it.

The executable icon is a blue diamond with two partially visible gear wheels. Something like this (but bluer) : https://upload.wikimedia.org/wikipedia/commons/thumb/c/cc/Gnome-application-x-executable.svg/240px-Gnome-application-x-executable.svg.png.

Both versions of Firefox are the same (144.0.2). In the Help->About Firefox window, the /usr/bin/firefox is labelled as Mozilla Firefox Snap for Ubuntu.

Where does the desktop look for icons to be used for an application in the bottom panel? I see several Firefox icons under $HOME/tools/firefox/browser/chrome/icons/default/.

Thanks

Found a solution. Googled a bit and found that one way to fix this would be to mention an icon file in the Firefox .desktop file. There was a file called userapp-Firefox-Y11RE3.desktop under $HOME/.local/share/applications. It did not mention any icon file.

$ cat userapp-Firefox-Y11RE3.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
NoDisplay=true
Exec=/home/karthik/tools/firefox/firefox-bin %u
Name=Firefox
Comment=Custom definition for Firefox

Added the following line.

Icon=/home/karthik/tools/firefox/browser/chrome/icons/default/default128.png

Still did not fix the issue. Renamed the file to firefox.desktop. That fixed the issue.

Thanks

1 Like

I was wondering how the correct icon is displayed for /usr/bin/firefox. There is no firefox.desktop file in /usr/share/applications/.

/usr/bin/firefox is a shell script that execs /snap/bin/firefox (which is a symbolic link pointing to /usr/bin/snap). /usr/bin/firefox script contains the following lines

# GNOME Shell
OLD="firefox.desktop"
NEW="firefox_firefox.desktop"
FAVS=$(gsettings get org.gnome.shell favorite-apps 2> /dev/null)
if echo "$FAVS" | grep -q "'$OLD'"; then
  NEWFAVS=$(echo $FAVS | sed -e "s#'$OLD'#'$NEW'#")
  gsettings set org.gnome.shell favorite-apps "$NEWFAVS"
fi

This replaces firefox.desktop with firefox_firefox.desktop in GNOME settings. This file is found under /var/lib/snapd/desktop/applications/ and gives the icon as

Icon=/snap/firefox/7177/default256.png

Thanks

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.