I am trying to have a kivy GUI that starts automatically after boot on a raspberry pi 4 running headless raspbian (with a window manager installed). To do so, I added the following line to /etc/rc.local:
su -c /home/pi/dummyfolder/run_gui pi
The called script is
#!/bin/bash
# this stops the sleeping screen
killall light-locker
# set display - allows execution over ssh
export DISPLAY=:0
python3 /home/pi/dummyfolder/gui.py -a &
When I reboot my raspberry pi I don't see the GUI. Looking at the output of journalctl I can verify that my script is running.
When I run the shell script manually the GUI is displayed. The same is true when I directly run rc.local. I therefore assume that there's a problem in the boot-up sequence i.e. that a service needed to display the script is not yet running.
Does somebody have an idea what the problem is or if the boot sequence hypothesis is true?
Edit: Somebody proposed to set wait-for-network in the raspy-config. However, I can not do this as the gui must run when there's no network.