I'm a beginner Linux user, running Pop!_OS.
Pop!_OS is based on Ubuntu, but uses SystemD and Gnome. I have no idea if that's going to be relevant, but figured it wouldn't hurt to mention.
Here is what I'm attempting to accomplish:
1). After the screen is locked, set a timer for 30 minutes.
2). After the timer is expired, proceed with the shutdown.
3). If the screen is unlocked before timer expiration, cancel the shutdown.
I learned how to create a bash script, and tried this as an experiment:
#!/bin/bash
gnome-screensaver-command --lock
shutdown -r +2
It locked me out of my computer for two minutes before rebooting. I was unable to unlock the screen, open the terminal, and enter shutdown -c, to cancel shutdown.
It displayed this message on the lock screen:
"System is going down. Unprivileged users are not permitted to login anymore. For technical details, see pam_nologin(8)."
I don't want to make myself the root user.
The closest thing on the internet that I could find was this thread on Stack Exchange:
Lock system after awake suspend (incl. forced-shutdowns system after countdown)?
I have no idea what's meant by "X terminal", or a "virtual terminal", so I have no idea if that's applicable. I've already locked myself out of my computer once, so now I'm asking for help.
Basically, sort of like a "suspend, then hibernate", I'm trying to do a "lock, then shutdown", if that makes sense.
Thank you in advance for your advice.