i3status doesn't distinguish between Idle and discharging battery.
- Dominant language
- C
- Stars
- 653
- Forks
- 254
- PR merge metrics
- No merged PRs in 30d
Description
At some point i3status on my computer stopped correctly displaying battery status while battery is idle. It is a really annoying bug.
I'm using gentoo linux.
I've looked into the code and discovered that i3status treats `Discharging` and `Not charging` states the same way.
Could you please considering merging this small patch to fix it?
This is small change causes i3status to display `status_unk` string when battery state is detected as `Not charging`
```
diff --git a/src/print_battery_info.c b/src/print_battery_info.c
index 7465d17..f9fd037 100644
--- a/src/print_battery_info.c
+++ b/src/print_battery_info.c
@@ -187,8 +187,10 @@ static bool slurp_battery_info(battery_info_ctx_t *ctx, struct battery_info *bat
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") || BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Not charging"))
+ else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Discharging"))
batt_info->status = CS_DISCHARGING;
+ else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS=Not charging"))
+ batt_info->status = CS_UNKNOWN;
else if (BEGINS_WITH(last, "POWER_SUPPLY_STATUS="))
batt_info->status = CS_UNKNOWN;
else if (BEGINS_WITH(last, "POWER_SUPPLY_CHARGE_FULL_DESIGN=") ||
```
Contributor guide
Assessment
This issue has not been assessed yet.