California
Posts: 189
Joined: Sat Jun 06, 2015 2:33 pm

Start the GUI app after RPi boot

Sat Feb 15, 2020 9:31 am

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

User avatar
davidcoton
Posts: 4663
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Start the GUI app after RPi boot

Sat Feb 15, 2020 10:34 am

If it needs Python3, change python to python3 in the autostart command.
Signature retired

California
Posts: 189
Joined: Sat Jun 06, 2015 2:33 pm

Re: Start the GUI app after RPi boot

Sat Feb 15, 2020 6:02 pm

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


klricks
Posts: 6847
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Start the GUI app after RPi boot

Sat Feb 15, 2020 6:43 pm

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
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

California
Posts: 189
Joined: Sat Jun 06, 2015 2:33 pm

Re: Start the GUI app after RPi boot

Sat Feb 15, 2020 7:28 pm

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

Return to “Python”