]> git.sur5r.net Git - i3/i3status/commitdiff
battery: use POWER_NOW if CURRENT_NOW is not available
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 3 Nov 2010 13:07:47 +0000 (14:07 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 3 Nov 2010 13:08:22 +0000 (14:08 +0100)
CURRENT_NOW was deprecated for some battery types in recent linux kernels
(2.6.36)

src/print_battery_info.c

index c806493bd46253cd72530620623281541855321e..36de3c842021d9805f902fe21ecbc02810c56720 100644 (file)
@@ -58,6 +58,8 @@ void print_battery_info(int number, const char *format, bool last_full_capacity)
                         remaining = atoi(walk+1);
                 else if (BEGINS_WITH(last, "POWER_SUPPLY_CURRENT_NOW"))
                         present_rate = atoi(walk+1);
+                else if (BEGINS_WITH(last, "POWER_SUPPLY_POWER_NOW"))
+                        present_rate = atoi(walk+1);
                 else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Charging"))
                         status = CS_CHARGING;
                 else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Full"))