Page 1 of 1

Start the GUI app after RPi boot

Posted: Sat Feb 15, 2020 9:31 am
by California
Hello, I have the GUI app made in QT4 (python3), which I would like to run automatically after Pi3B boot.
On Pi2B I did it with (python2):

Code: Select all

nano /home/pi/.config/lxsession/LXDE-pi/autostart
@lxterminal -e python /home/pi/Project/main.py
This doesnt't work on Pi3, what would you suggest?
Regards, Vlado

Re: Start the GUI app after RPi boot

Posted: Sat Feb 15, 2020 10:34 am
by davidcoton
If it needs Python3, change python to python3 in the autostart command.

Re: Start the GUI app after RPi boot

Posted: Sat Feb 15, 2020 6:02 pm
by California
I know that, but what I don't know which autostart file is the correct one?
1... /etc/xdg/openbox/autostart
2... /etc/xdg/lxsession/LXDE/autostart
3... /etc/xdg/lxsession/LXDE-pi/autostart

Re: Start the GUI app after RPi boot

Posted: Sat Feb 15, 2020 6:36 pm
by gordon77
3

Re: Start the GUI app after RPi boot

Posted: Sat Feb 15, 2020 6:43 pm
by klricks
The default autostart (Buster) is the global one here:

Code: Select all

/etc/xdg/lxsession/LXDE-pi/autostart
If you have created a user autostart somewhere in /home/pi/.config/.... then the global autostart is completely ignored.
Note it is very important that the user autostart, if you have one, contains all the code found in the global autostart.

You can do a simple test and start a well known application from autostart such as pcmanfm (Filemanager) and see if that works before you try your own scripts.

Code: Select all

@pcmanfm

Re: Start the GUI app after RPi boot

Posted: Sat Feb 15, 2020 7:28 pm
by California
I don't have user autostart in /home/pi/.config/.... modifying autostart in option 3 gave positive result.
It works now as expected.

Thanks for help
Regards, Vlado