A simple suspend helper for lightweight window managers
Picture this: you just set up Awesome or xmonad and all the keyboard-tastic experience they offer. You even get gnome-settings-daemon and a screensaver running in your session. You leave. You come back a day or two later and the 8-core behemoth in your basement command center has been up and running the entire time. Ouch! What happened to suspend? It used to be that you could run gnome-power-manager and it would still work, but they moved all the actual mechanics of g-p-m into g-s-d and for some reason it’s not suspending.
FEAR NOT! You can still suspend. The xprintidle tool will tell you your idle time. Run it in a loop, if $idle > 1 hour then pm-suspend, right? BUT WAIT! You get a call from your wife when you are at work…
Wife: “The computer suspends after a minute every time I wake it up”…
Your session is idle but someone else is using the machine and is not idle. This is 80% more complex than you first thought (of course).
I present: sleeper 0.2