summaryrefslogtreecommitdiff
path: root/src/print_battery_info.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/print_battery_info.c')
-rw-r--r--src/print_battery_info.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/print_battery_info.c b/src/print_battery_info.c
index dd3211a..0f480b2 100644
--- a/src/print_battery_info.c
+++ b/src/print_battery_info.c
@@ -175,6 +175,8 @@ static bool slurp_battery_info(struct battery_info *batt_info, yajl_gen json_gen
batt_info->present_rate = abs(atoi(walk + 1));
else if (BEGINS_WITH(last, "POWER_SUPPLY_VOLTAGE_NOW="))
voltage = abs(atoi(walk + 1));
+ else if (BEGINS_WITH(last, "POWER_SUPPLY_TIME_TO_EMPTY_NOW="))
+ batt_info->seconds_remaining = abs(atoi(walk + 1)) * 60;
/* on some systems POWER_SUPPLY_POWER_NOW does not exist, but actually
* it is the same as POWER_SUPPLY_CURRENT_NOW but with μWh as
* unit instead of μAh. We will calculate it as we need it