I'm making this really nice script that is supposed to make my life a little bit easier by opening apps for me and I've ran into an issue with launching Firefox (or any similar browser really; same happens with Chromium as well).
Here's what my scripts do: I have initial script that launches a terminal window and runs my script in said window. That script is being launched through XFCE's sessions and startup (in bash, in a new xfce-terminal window) and works fine.
Now my second script looks like this:
foo=string
grep ';;' ~/sh.sh
read foo
#firefox &>/dev/null &
#disown
for (( i=0; i<${#foo}; i++ )); do
case ${foo:$i:1} in
0) nohup mypaint &>/dev/null & ;;
1) exo-open --launch TerminalEmulator ;;
2) gtk-launch firefox.desktop ;;
3) ~/shsh/lutris.sh ;;
4) nohup /usr/lib/chromium/chromium &>/dev/null & ;;
5) nohup mypaint &>/dev/null & ;;
6) nohup steam &>/dev/null & ;;
esac
done
sleep 5 && kill -1 $PPID
And the problem is: when I launch firefox through this script depending on the method I'm trying to use to detach firefox process from shell one of the two things happen: either firefox is being closed with terminal window or terminal window closes with tabs crashing (and addblock no longer working as well).
Here's the methods I've used so far:
- multiple different combinations of
nohup
,&>/dev/null &
anddisown
gtk-launch firefox.desktop &
anddisown
(firefox &)
anddisown
(this one works really well if you just type it in but doesn't work the same way in script)
And interestingly enough firefox
does become a child of the init
process but still dies, or tabs are still crashing, when terminal window is being closed through script.
So at this point it's either Firefox being a bitch or I'm missing a puzzle piece.