My 3-year girl loves SuperTux. She can't control the mouse, so the game should run automatically on startup. After the game, the computer should shut down automatically.
However when I put the below command in "crontab -e":
@reboot env DISPLAY=:0.0 /usr/games/supertux2 && echo "PASSWORD" | sudo -S shutdown -h now
The first part runs the game on an old PC at boot time. I expected the second part of the command to turn off the computer when my girl exits the game but it isn't working.
Doesn't the chain-command
A && B mean when the A finished, start B?
How can I automate the powering off computer when the game is closed?