Shutting down on low battery
What's the recommended way to force a laptop to shut down when the battery gets too low? I know the Gnome and KDE ports claim to have this functionality, but I'm not running a desktop manager.
I accidentally ran out of juice the other day and the laptop turned off without syncing. The filesystems were mostly ok, but I lost four of the nine cells in the battery.
Since then I've put a rule in sensorsd.conf to run shutdown when the battery gets too low, but it seems like this might something that is handled automatically by the ACPI or APM subsystem. But I can't find any setting that might control this. I am seeing a low capacity sensor (hw.sensors.acpibat0.watthour2) which is currently showing 0.02 Ah, but that is not settable and I don't think the OS uses it for anything.
The only thing google turned up was a blog post that described using a cron job to check the battery level, which sounds kludgier than just using sensord.
Last edited by kmike; 27th March 2015 at 01:51 PM.
Reason: misspelled sensorsd
|