My 3-year girl loves SuperTux. she couldn't control the mouse! so the game should run automatically on startup and after the game, computer should shut down automatically, too.
however 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 can turn off the computer when my girl exit the game. but it can't.
does not the chain-command
A && B mean when the A finished, start the B?
how can I automate the powering off computer when the game is closed?