Using Arch Linux, a recent kernel update broke ibam. It only printed "No apm data available."
After downloading the source, I tracked the bug to line 962 of ibam.inl, and spotted 2 problems:
* only "BAT1" is checked ; on my machine, i have "BAT0" instead
* inside the BAT1 directory, it tries the file "charge_full" ; on my box it should be "energy_full"
I've read that the exact names of devices under /sys/class/power_supply vary depending on what drivers are used; but I believe the file names within are consistent.
The code that actually retrieves information from sysfs appears to be fine, I didn't have to make any changes to it.
The included patch works on my box, and should for any other laptop with a battery named BAT0...
There should be a better way to detect the battery's name than just trying to open each file in turn, but I'm not sure what that would be...
Patch for my machine, will not work for all.