I wrote a bash script to open an app (by double click) in my chromium. The code works but after opening the app when i close terminal the app also closes. I have searched through web and found out nohup, disown and & commands and tried it on my bash script but nothing works can you tell me what is happening

This will open the app

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

when i added disown to it the app is not even opening

/usr/bin/chromium-browser --disable-gpu --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --app=chrome-extension://jbnkffmindojffecdhbbmekbmkkfpmjd/foreground.html & disown
  • "I wrote a bash script to open an app (by double click)", does this mean you're running the script from a .dektop file? – kos Jun 22 '15 at 5:46
  • Also if so, please add the Exec= line from the .desktop file – kos Jun 22 '15 at 5:53
  • its not a .desktop file but a .sh. I made my bash script executable and changed the behaviour on nautilus to execute bash script instead of opening it – potholiday Jun 23 '15 at 5:34

Try the following code:-

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

Is this what you wanted? Did it work for you?


disown is a separate command you have run it on it's own. The best way to do so is to put it in an extra line:

/usr/bin/chromium-browser --disable-gpu --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --app=chrome-extension://jbnkffmindojffecdhbbmekbmkkfpmjd/foreground.html & 
  • still not working..app closes when terminal close – potholiday Jun 22 '15 at 5:32
  • I tested it with xclock instead of chromium, it works fine. So either you are calling the script in a different way or there is something special in chromium. – Klaus D. Jun 22 '15 at 5:38
  • & implicitly ends the previous command, so there's no need to put disown on the following line – kos Jun 22 '15 at 5:43
  • K sorry i forgot to add & before but now i added & and disown . Now app is not even opening. Have you tried executing the bash script by double click? – potholiday Jun 22 '15 at 5:51

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.