If for whatever reason you need to shutdown the pc after x hours you can use an easy command to do so.
To shutdown the computer at a fixed hour, lets say 23:15, use this command in the terminal:
sudo shutdown 23:15
To shutdown the system after x minutes, lets say 30, use this command in the terminal:
sudo shutdown +30
extra options:
add -r at the end of the command if you want the system to be rebooted instead of shutdown, it would look something like this:
sudo shutdown 23:15 -r
To cancel the shutdown command use this:
sudo shutdown -c
notes:
1. set a shortcut for the terminal (I use f12) using “system -> preferences -> keyboard shortcuts
2. use the command “man shutdown” to learn about the other options
3. the word “sudo” means that this command will be executed a root, thus you’ll need the administrator password if you want to use it.