Hello,
I'm trying to automatically start VLC player with a RTSP stream on startup.
I tried this via a script in /home/username/.config/lxsession/LXDE/autostart but this doesn't seem to start VLC player. I added some logging in the script and it seems that the script does run but just VLC player doesn't open.
I also tried adding some delay with sleep 30 which also doesn't work.
Another thing I tried was via crontab -e @reboot /home/username/script.sh. This also doesn't work.
Running the script manually via cli works and starts VLC player with the stream.
I'm using a Raspberry Pi 5B with bookworm os.
Any suggestions as to why it doesn't work?
Yes.
RPiOS Bookworm defaults to wayland and labwc so anything LXDE related won't work.
@reboot cron jobs are started before the desktop, potentially before networking is available, and you also need to specify which DISPLAY to connect to. Inserting a fixed length delay is a hack that may help some of the time with some of the causes but will not work all of the time with all of the causes.
Statistics: Posted by thagrol — Mon Mar 24, 2025 10:49 pm