I have a Raspberry Pi Zero 2W running Raspberry OS Lite (based on Debian 11 Bullseye, no desktop environment) that runs a startup shell script after an automatic login. The script uses the xinit command to run a graphical application and then to shutdown:

sudo xinit case_test.rpi3 --video-driver GLES2; shutdown now

The xinit command runs as expected and starts the graphical application. However, as soon as the application is loaded, the shutdown command is executed meaning I cannot interact with the application.

What I want to happen is for the application to launch as it does, allowing me to interact with it as long as I want, and when I choose to exit the application and return to the console, the system will then shutdown automatically. Any good ways of writing this in the shell script?


1 Answer 1


Found out a solution myself, the command above omits ./ before the name of the file. Now the program runs as expected and once I quit it, it will shutdown.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .