1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-13 03:11:16 +00:00

Fix shown battery status patch.

Fix shown battery status when the battery is not charging any more but is not full charged patch sf.net id #2556056 (thanks Martin).
This commit is contained in:
Martin Tůma 2009-02-17 22:19:25 -07:00 committed by Brenden Matthews
parent 5640da7c84
commit f7aeae2c01
2 changed files with 32 additions and 28 deletions

View File

@ -15,6 +15,8 @@
* Fix nvidia memory frequency reading patch sf.net id #2493134 * Fix nvidia memory frequency reading patch sf.net id #2493134
* Patch to clarify things in conky.conf sf.net id #2548805 (thanks * Patch to clarify things in conky.conf sf.net id #2548805 (thanks
Carpathia). Carpathia).
* Fix shown battery status when the battery is not charging any more but
is not full charged patch sf.net id #2556056 (thanks Martin)
2009-02-15 2009-02-15
* Added out_to_x * Added out_to_x

View File

@ -1787,7 +1787,9 @@ void get_battery_stuff(char *buffer, unsigned int n, const char *bat, int item)
} }
/* unknown, probably full / AC */ /* unknown, probably full / AC */
} else { } else {
if (acpi_last_full[idx] != 0 if (strncmp(charging_state, "Full", 64) == 0) {
strncpy(last_battery_str[idx], "full", 64);
} else if (acpi_last_full[idx] != 0
&& remaining_capacity != acpi_last_full[idx]) { && remaining_capacity != acpi_last_full[idx]) {
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]));