1

I have a python program that I would like to automatically run after logging in. This shouldn't be much of a problem, however, I would like the terminal to be in fullscreen mode while running the program.

I'm using two shell scripts. The first one (autostart.sh) starts up a terminal in fullscreen mode and then runs the second script:

#!/bin/bash
gnome-terminal --full-screen -e /home/me/scripts/start_python.sh

The second script (start_python.sh) is supposed to run the actual python program:

#!/bin/bash
python3 /home/me/scripts/python_app.py

Unfortunately, my python program just quits without returning anything after a few seconds. However, if I run the python program or any of the two scripts directly from the terminal after cd-ing into their directory everything works fine. But as soon as I start my python program using an absolute path (like in the second shell script), things don't work out anymore.

Is there any way, to start that python program without cd-ing into its directory by hand? Or can the problem be solved by just moving eveything to different directory? Right now, both shell scripts and the python program are in the same directory (/home/me/scripts).

  • Shouldn't there be a # before the !/bin/bash in the second one? – UniversallyUniqueID May 25 '16 at 14:48
  • Sorry, my mistake, it's actually in my script, I just forgot it when I wrote my post. I've corrected it now. – lysigk May 25 '16 at 14:56
  • How do you set it to start at boot? DE's autostart? systemd? – UniversallyUniqueID May 25 '16 at 14:59
  • 1
    Also, you don't need two scripts -- just put python3 /home/me... after the -e in the first one. – UniversallyUniqueID May 25 '16 at 15:00
  • 1
    What if you put some quotes around python3 yourscript.py so it knows it's one command? – Timo May 26 '16 at 7:17

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.