mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-27 20:44:56 +00:00
If we're on AC, there is no battery.
Again, no point in having two ways to say the same thing.
This commit is contained in:
parent
8852c0083c
commit
54a5cb8cbb
@ -1898,7 +1898,7 @@ void get_battery_stuff(char *buffer, unsigned int n, const char *bat, int item)
|
|||||||
snprintf(last_battery_str[idx], 64, "unknown %d%%",
|
snprintf(last_battery_str[idx], 64, "unknown %d%%",
|
||||||
(int) (((float)remaining_capacity / acpi_last_full[idx]) * 100));
|
(int) (((float)remaining_capacity / acpi_last_full[idx]) * 100));
|
||||||
else
|
else
|
||||||
strncpy(last_battery_str[idx], "AC", 64);
|
strncpy(last_battery_str[idx], "not present", 64);
|
||||||
}
|
}
|
||||||
} else if (acpi_bat_fp[idx] != NULL) {
|
} else if (acpi_bat_fp[idx] != NULL) {
|
||||||
/* ACPI */
|
/* ACPI */
|
||||||
@ -2029,7 +2029,7 @@ void get_battery_stuff(char *buffer, unsigned int n, const char *bat, int item)
|
|||||||
snprintf(last_battery_str[idx], 64, "unknown %d%%",
|
snprintf(last_battery_str[idx], 64, "unknown %d%%",
|
||||||
(int) ((remaining_capacity * 100) / acpi_last_full[idx]));
|
(int) ((remaining_capacity * 100) / acpi_last_full[idx]));
|
||||||
} else {
|
} else {
|
||||||
strncpy(last_battery_str[idx], "AC", 64);
|
strncpy(last_battery_str[idx], "not present", 64);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose(acpi_bat_fp[idx]);
|
fclose(acpi_bat_fp[idx]);
|
||||||
@ -2050,7 +2050,7 @@ void get_battery_stuff(char *buffer, unsigned int n, const char *bat, int item)
|
|||||||
|
|
||||||
if (life == -1) {
|
if (life == -1) {
|
||||||
/* could check now that there is ac */
|
/* could check now that there is ac */
|
||||||
snprintf(last_battery_str[idx], 64, "AC");
|
snprintf(last_battery_str[idx], 64, "not present");
|
||||||
|
|
||||||
/* could check that status == 3 here? */
|
/* could check that status == 3 here? */
|
||||||
} else if (ac && life != 100) {
|
} else if (ac && life != 100) {
|
||||||
|
Loading…
Reference in New Issue
Block a user