On 09/12/2024 19:53, Anssi Saari wrote:
I think every desktop environment has this. Even X has this. 'This'
being a timer since last mouse or keyboard event and the ability to
trigger a command on the timer. I looked recently but didn't really find
a way to do the Windows like thing, turn off screen->suspend->hibernate
with configurable intervals. Desktop environments do have that and KDE
does it fine on my Linux laptop but with just X11 and a WM it's a
different story.
(I would leave aside VNC sessions at least for a while.)
Screensavers that are able to put monitors in standby state (sometimes
without stopping to eat CPU though) have been existing for decades. I do
not expect that any of them may suspend the machine out of the box.
Perhaps some of them might allow to configure a custom user command.
Nowadays GUI applications communicate through D-Bus. You may try e.g.
light-locker that notifies systemd-logind about user inactivity. My
impression is that systemd allows suspending after some interval of time.
Handy for video
players, for example, but backup jobs too. I don't know if Linux has
anything like that. Well, you can disable the X screensaver which
probably works for movies but that doesn't matter a whole lot to a batch
backup job.
Applications may inhibit screensaver and screen locker (e.g.
"light-locker-command --inhibit"). For system-critical tasks there is
systemd-inhibit(1) and I would consider it for backups instead of
load-based heuristics.