1

I have developed a bash script to open chromium on startup and then execute another python script. However, when I run a certain webpage bash seems to stick at the open chromium line until chrome is closed, then the python script will execute. I want the python script to execute straight after chromium line has executed.

Here's the script

    #!/bin/bash
: '
Script to clean up temporary files, start chrome and start python script
'
rm -rf ~/.chromium_temp_dir
DISPLAY=:0 chromium-browser --disable-translate --user-data-dir=.chromium_temp_dir --start-fullscreen http://ebsbi/Reports/
python3 /home/pi/LoginandSelectScreen.py
5

You probably need to execute chromium in the background: add a & at the end of the line that invokes it. Like this:

DISPLAY=:0 chromium-browser --disable-translate --user-data-dir=.chromium_temp_dir --start-fullscreen http://ebsbi/Reports/ &
|improve this answer|||||
  • Brilliant that works for the address I gave (i shortened it while testing) but actual path i wanted doesnt work. This is what i tried for the line in question "DISPLAY=:0 chromium-browser --disable-translate --user-data-dir=.chromium_temp_dir --start-fullscreen ebsbi/Reports/Pages/Report.aspx?ItemPath=%2fSales%2fSAN002 &" – resolver101 Sep 13 '17 at 15:45
  • AFAICT, the address should not make any difference: the script should start chromium visiting that address in the background, and it should then go on to execute the python script. Is there any interaction between the python script and the page you are visiting? – NickD Sep 13 '17 at 17:18
  • Yeah I'm using pygui which uses the mouse and keyboard operations. However, I've output the python to a log and I don't see the start debug operations until I close chrome again. – resolver101 Sep 13 '17 at 17:26
  • You should probably ask another question and provide the details of what the page is doing and also what the script is doing. The problem seems to be some hidden connection between those two. As a hypothetical, if the page somehow takes an exclusive lock on a file and the script tries to take the same lock, you would see the symptom you are seeing. But there is no way to get that information unless we know a lot more about what each is doing. – NickD Sep 13 '17 at 17:34

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.