This is on a Macbook 2,1 dual booting Arch Linux and OS X Leopard.
I use a conky script to disply my battery percent with:
${battery_percent BAT0}
Recently, it switched from displaying coherent values to something like (its current output):
2147483648
I checked in /sys/class/power_supply/BAT0 directly, as I believe this is what conky uses to calculate its values. Files I know used to have coherent values had turned to 0.
I dual boot with OS X and on a whim I tried re-booting from Linux -> OS X -> Linux. I'd been living in Linux (mostly pm-suspending, but occasionally shutting down/rebooting, but only from Linux -> Linux). It worked. I now have values in the files again and conky is working. Here is a table of pre-post values:
All files from /sys/class/power_supply/BAT0
| File | Pre-Reboot | Post-Reboot |
|--------------------+-------------+-------------|
| energy_full | 0 | 41660000 |
| energy_full_design | 0 | 50200000 |
| energy_now | 0 | 35870000 |
| power_now | 0 | 15988000 |
| voltage_now | 0 | 11757000 |
| present | 1 | 1 |
| status | Discharging | Discharging |
|--------------------+-------------+-------------|
Not everything was useless. It knew it was discharging and present, but that's it.
Why would rebooting into OS X change the values for files under Linux in /sys/class/power_supply/BAT0? Is there some sort of hardware/firmware in the battery that OS X fiddles with? In other words, why a reboot from Linux -> Linux wouldn't work, but Linux -> OS X -> Linux does.