GNOME Bugzilla – Bug 89681
Battery applet doesn't work with two batteries
Last modified: 2004-12-22 21:47:04 UTC
The GNOME2 Battery Applet is not able to handle my laptop with two batteries correct. If one battery is empty and the other one is full, I get a warning about low battery. I assume it only checks for BAT1. On my System, I have /proc/acpi/battery/BAT1 /proc/acpi/battery/BAT2 (I have a Sony Vaio PCG-GR114MK and I use kernel 2.4.18 with the newest acpi-patch from www.sf.net/projects/acpi/). If you need any further information, contact me.
Created attachment 11305 [details] [review] patch for battstat_applet to support two batteries.
Patch attached which makes it possible for battstat to work correct with two batteries. It does not check if there are more than two batteries. I don't know if there are laptops that can have more than two batteries at the same time. If yes, then we should enhance it even more.
Created attachment 11422 [details] [review] battstat_two_batteries_v2.diff
New patch added. It now scans /proc/acpi/battery/ and /proc/acpi/ac_adapter, because I got reports that some people have a BAT0 or have an ac_adapter AC and not ACDC.
Created attachment 11556 [details] [review] battstat_two_batteries_v3.diff
Again an update for the patch, as v2 was quite unstable (forgot to close directories). Is anyone reading this bug? I posted it two months ago, made a fix and simply got no reply.
Hi Hanno. I'm the maintainer of gnome-applets. I'm sorry that noone has looked at your patch. The problem with me is that I don't have a laptop to test with so i'm hesitant to apply the patch. Maybe you could ask on desktop-devel-list to see if anyone understands the battery code and can review it?
I already posted to desktop-devel-list, but got no replys. I also sent the patch to acpi-devel and got positive feedback from some people. Well, the patch is quite trivial. Only thing is that it does no longer use hardcoded battery- and ac-information, but scans the /proc-dirs for them. v3 should be quite stable now.
To Kevin: It seems that you need someone who is responsible for the battery-applet. I could do some work on it. If you need my help, contact me. I have been working on these acpi-issues for some time. bug #88553 seems to address similar issues.
*** Bug 84847 has been marked as a duplicate of this bug. ***
Patch has been applied. Hanno: Does your patch really fix the problem? - that is, if battery 1 is empty will battstat now skip battery 1 and check battery 2? If so then you can close this bug.