I'm running the openbox WM and would like to avoid loading the gnome stack. One of the lingering issues I have to resolve is avoiding abrupt system crashes due to depleted battery power.
Is there a low-profile, low-dependency daemon that will handle this situation? I'd like to be able to configure it to, for example, drop the system down into hibernation at 4% battery life if the AC is not connected.
I suppose I could just write a little cron job to poll /sys/.../batt*/.. and /sys/.../ac*/... every 10 minutes or so, but it seems like there might be some edge cases that need tending.
update
laptop-mode-tools sounds promising:
It ... supports various ... power management features, such as ... automatically hibernating if battery levels are too low...
However, it doesn't seem to be possible to install it in Maverick without relatively dire consequences.
On my system, its installation also requires the removal of the acpi-support package, which sounds sort of ominous.
battery.*get triggered. Also I was hoping for something that would abstract away all the gritty polling and/proc/**/*bits. – intuited Apr 02 '11 at 05:11acpidshould be doing that for you; the ACPI BIOS sends thebattery.*events, and you would have an/etc/acpi/events/batterywhich selects forbattery.*events and runs a script to act on them. The script examines the name of the event to see what triggered it, and if it's a "battery low" event should do a shutdown or suspend. – geekosaur Apr 02 '11 at 05:17/procor/systo find out why a battery event was generated. At least it looks that way:::::: I just dropped down to 0% battery capacity (according towmbattery). I've set up an event handler/etc/acpi/events/log-all-eventsthat responds toevent=.*with a call to/usr/bin/logger '%e'. The only event that was registered when I hit 0% capacity wasbattery BAT0 00000080 00000001. The exact same message is generated when I connect or disconnect the AC. – intuited Apr 03 '11 at 10:15