2

My specs: Ubuntu 20.04.3 with Gnome Shell on Wayland. Notebook Acer Aspire 5 with AMD Ryzen 7 5700U.

For my work, I want to run Firefox through the sandboxing utility firejail. I created a custom *.desktop file to launch the "firejailed" firefox and placed it in ~/local/share/applications.

In the *.desktop file, I specified a custom icon (the blue Firefox icon that is used for the nightly builds) and the custom launcher uses this blue icon. Ok, fine.

When I run the launcher, the "firejailed" Firefox starts and runs correctly but the icon that is displayed in the window overview and in the task bar (or dock) is the standard Firefox icon (orange/yellow) not the blue one I specified.

What I have to do so that the running "firejailed" Firefox is displayed in Gnome Shell with the blue icon?

Here is how my *.desktop file looks like:

[Desktop Entry]
Version=1.1
Type=Application
Name=Firefox Work
Comment=Web Browser configurated for Work
Icon=firefox-nightly
Exec=firejail --private=/home/nuri/.firejail-firefox/ firefox -no-remote
Actions=
Categories=Network;
StartupNotify=true
nuri
  • 212

3 Answers3

2

For those who want to have the practical solution, the working *.desktop file looks now like this:

Version=1.1
Type=Application
Name=Firefox Arbeit
Comment=Web Browser configurated for Work
Icon=firefox-nightly
Exec=firejail --private=/home/nuri/.firejail-firefox/ firefox -no-remote --class=fjfox
Actions=
Categories=Network;
StartupNotify=true
StartupWMClass=fjfox
nuri
  • 212
1

Have this specific instance of firefox launch with a specific WMClass by adding the option

--class=CLASS

where CLASS is a name of your choosing, e.g. fjfox.

Then connect your custom .desktop laucher to that WMCLass by adding a line as

StartupWMClass=CLASS

See the answer of nuri for a full example of the desktop file.

vanadium
  • 97,564
1

In Ubuntu 22.04 running Wayland, you have to change the .desktop file as above. Use --name instead of --class= in the Exec line.

Version=1.1
Type=Application
Name=Firefox Arbeit
Comment=Web Browser configurated for Work
Icon=firefox-nightly
Exec=firejail --private=/home/nuri/.firejail-firefox/ firefox --no-remote --name fjfox
Categories=Network;
StartupNotify=true
StartupWMClass=fjfox
nuri
  • 212