Xinqi Bao's Git
projects
/
slstatus.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
battery: fixed remaining time on connected AC
[slstatus.git]
/
components
/
battery.c
diff --git
a/components/battery.c
b/components/battery.c
index
53d94b5
..
84b2c11
100644
(file)
--- a/
components/battery.c
+++ b/
components/battery.c
@@
-121,8
+121,12
@@
struct apm_power_info apm_info;
if (load_apm_power_info(&apm_info)) {
struct apm_power_info apm_info;
if (load_apm_power_info(&apm_info)) {
- return bprintf("%u:%02u", apm_info.minutes_left / 60,
- apm_info.minutes_left % 60);
+ if (apm_info.ac_state != APM_AC_ON) {
+ return bprintf("%u:%02u", apm_info.minutes_left / 60,
+ apm_info.minutes_left % 60);
+ } else {
+ return strdup("");
+ }
}
return NULL;
}
return NULL;