What? You've lost me completely. .desktop files are not specific to Gnome.
Modifying the Exec= line is trivial. Use sudoedit on the file. Done. I didn't want to be accused of talking down to someone who knew what they were doing, so I didn't provide too many details.
For example, let's find the .desktop file for the chromium browser:
Code:
$ locate .desktop|grep chromium
/snap/chromium/1461/bin/chromium.desktop
/snap/chromium/1461/meta/gui/chromium.desktop
/usr/share/applications/chromium-browser.desktop
/var/lib/snapd/desktop/applications/chromium_chromium.desktop
I don't use any DE or menus, so I can't easily figure out which is being used by any DE, but that's the list on a 20.04 desktop system of some sort. The 'snap' parts cannot be modified - snap packages suck - but ....
Code:
$ ll /usr/share/applications/chromium-browser.desktop
-rw-r--r-- 1 root root 12478 Sep 18 10:14 /usr/share/applications/chromium-browser.desktop
looks promising.
Code:
$ sudoedit /usr/share/applications/chromium-browser.desktop
Ok, there are multiple Exec= lines in that file for different menu entries and languages.
Let's see if we can't narrow that down a little.
Code:
$ egrep Exec= /usr/share/applications/chromium-browser.desktop
Exec=chromium-browser %U
Exec=chromium-browser
Exec=chromium-browser --incognito
Exec=chromium-browser --temp-profile
If I were guessing, I'd guess that the first one above is used with any right-click. Can we get more data?
Code:
$ egrep 'Name=|Exec=' /usr/share/applications/chromium-browser.desktop
Name=Chromium Web Browser
GenericName=Web Browser
Exec=chromium-browser %U
Name=Open a New Window
Exec=chromium-browser
Name=Open a New Window in incognito mode
Exec=chromium-browser --incognito
Name=Open a New Window with a temporary profile
Exec=chromium-browser --temp-profile
Ok, now we have the "name/generic name" and the Exec= line that goes with it.
So ... let's change the "Open a New Window" version to call firejail ... make these changes using sudedit:
Code:
Name=Open a New Window in Firejail
Exec=/usr/bin/firejail /usr/bin/chromium-browser
I use the full path to ensure the exact program I want gets used, not something else in my PATH environment variable that happens to be first.
Give that a try. See if it works.
All the "snap" version get replaced whenever the snap package is updated, I think. Also, those located under /snap/chromium/ are created using loop mounts by the snap initialization crapola during boot. I don't really know all the details about snaps and when things happen. Much easier to avoid them whenever possible. Plus, firejail and snaps create conflicts so it won't work on most systems. I tweaked my system to run Chromium browser outside a snap.
Firefox runs fine inside a firejail, however. Just tested it. /usr/share/applications/firefox.desktop is the only location with a firefox.desktop file on my system. It also has multiple Exec= lines for similar startup options. Just put firejail in front of each. If you don't want anything written to the disk, use firejail --private and an overlay file system will be used. That's great until you want to save a file or print.
Bookmarks