Open Apps with Dedicated Graphic Card

Greetings to all,

The goal is to have certain app like firefox starts on the discrete card.
I created an alias in Bash (see below). I used the ‘setsid’ to run the program in a new session.
When I closed my terminal, firefox closes with it. I thought the ‘setsid’ would allow me to close the terminal without having the app close as well.

Is there a way so I can close the terminal and not worry the app started on the discrete graphic card closes with it ?

alias f='DRI_PRIME=1 setsid firefox >/dev/null 2>&1 &

first this could be a typo here but you don’t have a closing quote mark.

second I think you need to set the Variable for DRI_PRIME before calling it in the alias.

Thanks for your reply.

Indeed it is. Just copy and paste that did not work well from the terminal :slight_smile:

Actually just found the solution. I have added the ‘nohup’ command. Firefox now runs even after closing the terminal.

Thank you for your time. Much appreciated.

I am using alias to have a specific workflow when my rig is connected to power supply. When not connected to power supply, I just click on Firefox and it starts on the iGPU. Actually in my case, I just recently learned that I have an APU.

EOS and Linux + a brilliant community → Only the sky is the limit.

Thank you all.

1 Like

If I’m reading right, you seem to have both setsid and & there, but only one of them is enough…

that would be true for Firefox.
I use Freetube. If you do not put the setsid when running the command. when I close my terminal, freetube closes with it.
This is the behavior I am trying to avoid.

The setsid is OK, no problem with that.
The trailing & looks redundant, but does freetube need that too?

only setsid works here when used with freetube in bash under alacritty

setsid freetube close the open alacritty window and freetube stays open

freetube & closes the open alacritty window and the freetube session.