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.
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.
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.
Hey there, I am trying to do the same thing. I am using fedora 40 and i want my firefox to use my nvidia gpu. How do i make sure that when there is a firefox update it doesnt ruin everything?
Do as suggested.
Make a copy of the /usr/share/applications/org.mozilla.firefox.desktop in your home directory ~/.local/share/applications/ then edit the .desktop file that is under your home directory to make the changes. That file does not get overwritten when firefox is updated and also is the preferred desktop file to use for launching apps.