Recently I've noticed my X40's battery life appears to not be what it once was. I was curious to work out precicely what it is, so I delved into the debian packages to see what I could find.

There are two popular "standards" for power management: APM and ACPI. Hardware support for the two standards varies wildly across laptops, which is why we haven't entirely ditched APM and moved to ACPI for everything. The X40 (and thinkpads in general) have great ACPI support, so I use ACPI.

Unfortunately most of the packages I've found that look like they might do what I want are for APM only:

...periodically collect charge/discharge patterns over time...requires APM...
...advanced battery monitor for laptops...statistical and adaptive linear methods...requires /proc/apm.

Some other tools sounded great, but also a bit self-defeating:

...reads various system statistics and updates RRD files... promising so far; the statistics are very fine-grained since the files are updated every 10 seconds. Ack! The heisenberg principle will probably kick in a bit here, if the hard disk is going to spin up every 10 seconds.

It's starting to look like it might be worthwhile porting one of these to ACPI. Ben Hutchings is going to send me some example code he uses to monitor his battery in ion3.

Mental note: file patches for the descriptions of those packages which do not make it clear which interface they support.