0

I have a chromium app which i want to execute from a bash script. I am successfully able to execute this command from terminal and able to open the app but when i tried to double click the script the app is exiting as soon as the script is executed.

#!/bin/bash

nohup /usr/bin/chromium-browser --disable-gpu --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --app=chrome-extension://jbnkffmindojffecdhbbmekbmkkfpmjd/foreground.html & disown &

How can I open chromium app by double clicking the script?

0

I can't answer your question to fit with your exact code, however I can recommend a few things.

First, make sure to make the script executable by cding to its location and running chmod +x ./scriptname.sh. This will sort of solve your double click issue; you cannot make it executable by a double click but this way you can execute it with Alt-F2. Just put it in your home folder and run ./scriptname.sh.

As for why it quits: I'm not totally sure but it seems like you have an overload of commands in there. nohup, disown and & all do different things, as explained here, but you may not want to do all of them and they may be conflicting somehow. I would recommend removing the last & at the very least.

The thing is, nohup and disown make your process ignore a SIGHUP, which you may need to use in the event of a hang, especially given it's Chrome. In this case, just run the command without nohup or disown, and just one & at the end. This will keep your process as-is except your terminal window is free to do other actions, including close.

Another thing you could try is making this script open its own terminal window. This is written as follows:

gnome-terminal -e /usr/bin/chromium-browser (et cetera)

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.