On Mon, 2005-04-04 at 10:08 +0200, Arjan van de Ven wrote: > we very much need a generic "am I on battery" app that internally can > cope with both apm, acpi and any other thing other platforms might use, > while giving a unified answer to the rest of the world. That is what g-p-m will provide once we figure out the best way to get the system-wide things factored in. Essentially, you want something sitting on the system-wide message bus with - Methods - bool isOnBatteryPower() - int secondsIdle() - Async Signals - nowOnMains() - nowOnBattery() - nowIdleForLongTime() # fires after e.g. 5 minutes of idleness - noLongerIdle() # fires when user is no longer idle Legacy scripts can just use dbus-send for isOnBatteryPower() and secondsIdle() (or we may wrap the calls in easy-to-use binaries) while newer stuff can hook in and e.g. pause the updatedb process when the noLongerIdle() signal is received. We sort of need to move away from the shell script crazyness because it doesn't play nice with e.g. receiving noLongerIdle() and pausing. David > This is a case where the kernel should have provided an abstraction of > the hardware, but didn't, and it's now mostly too late to fix that ;( We can do all this in user space (and the right way, with D-BUS), no need to bloat the kernel :-) Cheers, David