Workaround for freerunner battery
authorEnrico Zini <enrico@enricozini.org>
Wed, 30 Sep 2009 13:28:13 +0000 (14:28 +0100)
committerEnrico Zini <enrico@enricozini.org>
Wed, 30 Sep 2009 13:28:13 +0000 (14:28 +0100)
src/app_power.vala

index 2176025bb36b7e6e5bbec8a1608470b61dab81b6..7d2ca2bbd9f9e00c9ec5d9e84a3ac1744cee754a 100644 (file)
@@ -596,7 +596,10 @@ public void init()
                Dkp.Device dev = (Dkp.Device)devs.pdata[i];
                stderr.printf("Found new device %s\n", dev.native_path);
                dev.print();
-               if (!dev.is_rechargeable) continue;
+               stderr.printf("Rechargeable: %s\n", def.is_rechargeable ? "yes" : "no");
+               // On the FreeRunner, for some reason the battery does not
+               // appear as rechargeable, so I also match it literally
+               if (!dev.is_rechargeable || dev.native_path != "/sys/class/power_supply/battery") continue;
                var bi = new BatteryIcon(dev);
                bi.set_visible(true);
                battery_icons.add(bi);