]> git.sur5r.net Git - i3/i3status/commitdiff
Add support for "POWER_SUPPLY_STATUS=Not charging" (fixes #304)
authorDavid96 <davidlepplaweber@aospa.co>
Mon, 3 Sep 2018 18:50:36 +0000 (20:50 +0200)
committerDavid96 <davidlepplaweber@aospa.co>
Mon, 3 Sep 2018 18:50:36 +0000 (20:50 +0200)
src/print_battery_info.c

index 8c85192f20f916b6544921e2740b0e0ce0424f58..3ac8c11e35507cd793e38a63e4aaf7f86d7deef6 100644 (file)
@@ -179,7 +179,7 @@ static bool slurp_battery_info(struct battery_info *batt_info, yajl_gen json_gen
             batt_info->status = CS_CHARGING;
         else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Full"))
             batt_info->status = CS_FULL;
-        else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Discharging"))
+        else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Discharging") || BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Not charging"))
             batt_info->status = CS_DISCHARGING;
         else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS="))
             batt_info->status = CS_UNKNOWN;