From 75670ba64a43f3382e5163b6ea7bf27de28d929b Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 3 Nov 2010 14:07:47 +0100 Subject: [PATCH] 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) --- src/print_battery_info.c | 2 ++ 1 file changed, 2 insertions(+) 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")) -- 2.39.5