On 10/02/2012 11:21 AM, Bober, Mark wrote:
Nice! That's a lot cleaner than my hacked-up set of scripts. I'll try it
as soon as I can.

I noted your comment about /dev/input/mice not working  in zz_hibernate
- here's how I did that part:

This program; xidle.c:

#include <stdio.h>
#include <X11/extensions/scrnsaver.h>
#include <X11/Xlib.h>

main() {
    XScreenSaverInfo *info = XScreenSaverAllocInfo();
    Display *display = XOpenDisplay(0);

    XScreenSaverQueryInfo(display, DefaultRootWindow(display), info);
    printf("%u\n", info->idle);
}

That outputs X's idle time in milliseconds. To get connected to the
running X session (my lab uses KDM right now):

kdmauth=` ps -aef | egrep  "X.*var/run/kdm" |fgrep -v grep| awk '{print
$16}'`
xauth merge $kdmauth
export DISPLAY=:0

I then compare the result of xidle vs. the time I wanted the console to
be idle.

It's not the best of solutions, but it seems to work out OK in practice.


Hmm, I'd forgotten that that code was in zz-hibernate as well. I also set an iidle value via a load sensor, but I use a daemon called inputwatch. I just put the code up for that here, FWIW:

https://github.com/opoplawski/inputwatch

--
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder Office                  FAX: 303-415-9702
3380 Mitchell Lane                       [email protected]
Boulder, CO 80301                   http://www.nwra.com
_______________________________________________
users mailing list
[email protected]
https://gridengine.org/mailman/listinfo/users

Reply via email to