On Thu, 2002-06-06 at 12:48, Michael Schmitz wrote: > > sleepd works by watching the IRQ bus for interrupts. Specifically, > > looking through the code it looks through /proc/interrupts for anything > > that looks like an interrupt for a mouse or keyboard. > > > > Here's what my /proc/interrupts looks like. I'm using an iBook DV 466. > > > > CPU0 > > 19: 21205 OpenPIC Level ide0 > > 20: 244 OpenPIC Level ide1 > > 25: 783175 OpenPIC Level VIA-PMU > > The VIA-PMU interrupt is where keyboard and mouse activity hide in. Good > luck subtracting the baseline interrupt activity there, I suspect the > scheduling timer is in there as well :-)
Yeah, but wouldn't it suck if your laptop went to sleep while you were playing XBill with a USB mouse ? ;) Listening to /dev/input* is a better idea (on PPC, at least). I remember having some advices on using signals and select (iirc) when I wanted to implement such a thing for acme, for the "no-activity dimming", so that you wouldn't have to poll the devices. Sleepd would probably make a great daemon in which to implement such features (ie. After X minutes of inactivity, launch "foo"). Didn't closely look at it though. I might be wrong, I usually am. -- /Bastien Nocera, running away http://hadess.net
signature.asc
Description: This is a digitally signed message part