You are not logged in.

#1 2014-05-10 15:49:03

freelook
Member
Registered: 2014-04-28
Posts: 3

Automatically suspend when all users are idle

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

#2 2014-05-11 00:16:43

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: Automatically suspend when all users are idle

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

Board footer

Powered by FluxBB