multiple batteries in BatteryMonitor

Ylosar Goer ylosar.goer at free.fr
Mon Apr 19 10:26:11 CEST 2004


edscott wilson garcia wrote:
> Try the attached patch and see if it works OK (it should monitor the
> last battery to drain, instead of the first).

I applied this patch against v0.2.0 (because http://developer.berlios.de/ where i presume the cvs repository is, seems to be offline) and it effectively monitors the last battery to drain.

But i find strange that my BAT0 is batteries[1] (instead of batteries[0]) and i wonder if readdir (in check_acpi()) is really supposed to give batteries in reversed order. Is that an defined behavior ? Could readdir gives the content of /proc/acpi/batteries/ in a different order if... let's says... i were using a different filesystem type, or a different compiler (or someting) ?

It also shows 2 problems:

1/ When the monitored battery is not (yet) discharging, the remaining time displayed is wrong (it showed 72000 hours last time i checked, as far as i remember). The time displayed becomes ok as soon as the battery start to drain.

2/ Something weird: currently, according to /proc, my main battery remainging capacity is greater than its last full capacity (i wonder why!) and that gives me a '101% AC on-line' status, with a "panel level bar" having no color. The status and the bar becomes ok as soon as the main battery has been drained a little.

yop at wok yop $ cat /proc/acpi/battery/BAT0/info 
present:                 yes
design capacity:         71990 mWh
last full capacity:      70880 mWh
battery technology:      rechargeable
design voltage:          11100 mV
design capacity warning: 3000 mWh
design capacity low:     1000 mWh
capacity granularity 1:  200 mWh
capacity granularity 2:  200 mWh
model number:            DELL 4P259 
serial number:           1541
battery type:            LION
OEM info:                Panasonic
yop at wok yop $ cat /proc/acpi/battery/BAT0/state 
present:                 yes
capacity state:          ok
charging state:          unknown
present rate:            unknown
remaining capacity:      71990 mWh
present voltage:         12476 mV


voila,  hope it helps a litte



More information about the Xfce mailing list