Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5273

Python • Re: Automatic start up of main.py

$
0
0
Extra line was added to autostart:

Code:

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart@lxterminal -e /home/vlado/Project/env/bin/python3 /home/vlado/Project/main.py

That should work as expected if, and only if, you are running the X11 desktop.

If your 4B has 2GB RAM or more, you are running RPiOS Bookworm, and you have not changed it from the default it will be running wayland/wayfire which does not use /etc/xdg/lxsession/LXDE-pi/autostart.

See section 6.1.1 of Running A Program At Start Up A Beginner's Guide (link to github provided above and in my sig) for Wayland/wayfire. See s5.2.2 and/or s6.1.2 for a method that will work under both (and the majority of other window managers too).

If you want to switch to X from wayland, you can do so in raspi-config.

I'd advise reviewing my full guide to Running A Program At Start Up as relying on automatic login and the global LXDE-pi autostart file is insecure (see why in my guide) and inapropriate for any project that does not require the Desktop in order to run.

It's your choice though. If you understand the risks and implications, go ahead.

Statistics: Posted by thagrol — Sun May 19, 2024 11:58 pm



Viewing all articles
Browse latest Browse all 5273

Trending Articles