Yes there is also a shutdown
command in Linux. You can run this, in Desktop Mode, by launching the "Konsole" application.
If you run shutdown
then a shutdown will be scheduled for 60 seconds time. If you want to shutdown (much) later, then you can specify the number of minutes later. For example shutdown 120
will shut the host down in 120 minutes time.
The command doesn't support providing a time. So if you wanted the device to shut down at a specific time, you would need to work out how many minutes there are between now and the time you want it to shut down. For example, if it's 20:37 and you want it to shut down at 22:00, you would run shutdown 103
.
You can also run shutdown --help
to get a full list of the options:
shutdown [OPTIONS...] [TIME] [WALL...]
Shut down the system.
Options:
--help Show this help
-H --halt Halt the machine
-P --poweroff Power-off the machine
-r --reboot Reboot the machine
-h Equivalent to --poweroff, overridden by --halt
-k Don't halt/power-off/reboot, just send warnings
--no-wall Don't send wall message before halt/power-off/reboot
-c Cancel a pending shutdown
See the shutdown(8) man page for details.
As you can see, if you need to cancel the shutdown, then just use shutdown -c
.
You likely could also add the "Konsole" application as a non-Steam application to Steam, so that you can launch it from Gaming mode and then run the command there.
If you mean that you want it to shutdown at 22:00 every day, then I might actually recommend against that. Shutting down isn't the same as single pressing the power button, it's a full power off. This meana that if you were in the middle of a game, any and all unsaved progress would be immediately lost; you would not power the device back on and be able to resume your game from the last state it was in.
If you really want to though, you could have the following script run at "logon", but like I mentioned, this might have some odd behaviour with sleeping, and I don't handle turning the device on after 22:00.
TODAY=$(date +%Y%m%d)
TONIGHT=$(date -d "$TODAY 22:00" +%s)
#echo $TONIGHT
NOW=$(date +%s)
#echo $NOW
DIFF=$((($TONIGHT - $NOW)/60))
#echo $DIFF
shutdown $DIFF
Don't forget to give the user permissions to execute the script with chmod u+x {filename}
. So, if you placed the file in a directory called scripts
in your home directory it might be:
chmod u+x ~/scripts/eveningshutdown.sh
And then you would execute the script with:
~/scripts/eveningshutdown.sh