You are not logged in.
Hello,
I have not been able to find a way of checking if *all* users on the system are idle, and then suspending if they've been idle for a certain amount of time. Of course individual users might have the ability to set up sleep if they want, but I was looking for a way to set this up as the root user on the machine.
Can anyone recommend a way to do this?
Thank you very much
Offline
Welcome to the forums.
It all depends on your definition of idle.
For me it means that there is no user input from the keyboard and no movement of the mouse for a certain time. Therefore i use xautolock for suspending the system when it is idle using this command:
xautolock -time 20 -corners -000 -detectsleep -locker "systemctl suspend"
The corners argument provides a quick way to inhibit the automatic suspend by moving the mouse into the left upper corner. Time is in minutes.
On a home server a script checking for connected users is suited better:
http://wiki.ubuntuusers.de/Skripte/Auto … Das-Skript
(This link leads to a page written in german, however the script is written in bash and commented in english.)
Offline