From: Michael Stapelberg Date: Wed, 3 Nov 2010 13:07:47 +0000 (+0100) Subject: battery: use POWER_NOW if CURRENT_NOW is not available X-Git-Tag: 2.3~27 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=75670ba64a43f3382e5163b6ea7bf27de28d929b;p=i3%2Fi3status battery: use POWER_NOW if CURRENT_NOW is not available CURRENT_NOW was deprecated for some battery types in recent linux kernels (2.6.36) --- diff --git a/src/print_battery_info.c b/src/print_battery_info.c index c806493..36de3c8 100644 --- a/src/print_battery_info.c +++ b/src/print_battery_info.c @@ -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"))