Where is the Firefox (rpm) .desktop located?

Greetings,

tl;dr Essentially, what I want to do is always launch my Firefox using my Nvidia graphics card.

I’m on Fedora 39 Gnome on Wayland, with an intel+nvidia mx150 hybrid graphics setup. 95% of my needs are met with the intel running, but sometimes I will right click an icon on the overview and right click it to select “Launch using Discrete Graphics Card”

With Firefox I have to right click it everytime single time I want to launch it specifically with using my Nvidia-mx150, but I know there is a way to edit an applications .desktop file by adding PrefersNonDefaultGPU=true to the Desktop Entry and then saving it.

My question is where it the Firefox .desktop entry located so I can edit it? As an example I know for Tauon Music Box, it’s desktop entry is located here: sudo nano /var/lib/flatpak/app/com.github.taiko2k.tauonmb/x86_64/stable/active/export/share/applications/com.github.taiko2k.tauonmb.desktop but since Tauon is a flatpak and my Firefox is an rpm, this directory isn’t helpful to me.

Any thoughts? Appreciate any help, thank you.

It’s in /usr/share/applications. You can copy firefox.desktop from there into ~/.local/share/applications to edit it.

The same goes for the flatpak app, even more so. You must never edit flatpak app files, at risk of corrupting the ostree repo. Technically, I think exports are safe because they’re not ostree-backed, but at best they would be overwritten on every update.

2 Likes

For the record, you can find this with:

$ rpm -ql firefox | grep .desktop

But, if you edit that file, it’ll get overwritten whenever there is a firefox update, which is rather a lot. As Chris suggests, making a copy in your home directory is a better approach.