1

I am launching a new Chrome/Chromium window from the terminal with the --app parameter, trying to get the PID in the process, like so: chrome --app="data:whatever" & PID=$!

This returns a valid PID as long as the browser is not launched. However if the browser already had a window open, I get a message "Opening in existing browser session". There is still a number in the PID, but it has nothing to do with the process/window I just opened. When I run kill -0 $PID, the process is no longer there (but the app window still is of course).

Goal: I just want to know when someone closes the app that was launched form the script, and then execute some cleanup code.

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.