[hackers] [slstatus] battery: Fix remaining on Linux || Patrick Iacob
commit 982eb223a055db01bf03f44bf0203705ca7153e8
Author: Patrick Iacob <iacobp_AT_oregonstate.edu>
AuthorDate: Sat Nov 26 20:11:01 2022 -0800
Commit: drkhsh <me_AT_drkhsh.at>
CommitDate: Thu Dec 1 09:04:32 2022 +0100
battery: Fix remaining on Linux
The current version displays the remaining time as 'n/a'.
Fixes this regression introduced in 69b2487650782f135db76078c4a7fb841cb936ac
where current_now and power_now were incorrectly replaced with current and
power when they were moved to a macro.
diff --git a/components/battery.c b/components/battery.c
index b12c59e..9fa1014 100644
--- a/components/battery.c
+++ b/components/battery.c
_AT_@ -14,8 +14,8 @@
#define POWER_SUPPLY_STATUS "/sys/class/power_supply/%s/status"
#define POWER_SUPPLY_CHARGE "/sys/class/power_supply/%s/charge_now"
#define POWER_SUPPLY_ENERGY "/sys/class/power_supply/%s/energy_now"
- #define POWER_SUPPLY_CURRENT "/sys/class/power_supply/%s/current"
- #define POWER_SUPPLY_POWER "/sys/class/power_supply/%s/power"
+ #define POWER_SUPPLY_CURRENT "/sys/class/power_supply/%s/current_now"
+ #define POWER_SUPPLY_POWER "/sys/class/power_supply/%s/power_now"
static const char *
pick(const char *bat, const char *f1, const char *f2, char *path,
Received on Thu Dec 01 2022 - 09:08:17 CET
This archive was generated by hypermail 2.3.0
: Thu Dec 01 2022 - 09:12:32 CET