1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-26 04:17:33 +00:00

how about actually reading the battery vars -- doh

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@782 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Philip Kovacs 2006-11-18 23:39:43 +00:00
parent b98faaadce
commit 73aa3c2b4c

View File

@ -1252,17 +1252,14 @@ void get_battery_stuff(char *buf, unsigned int n, const char *bat)
break;
/* let's just hope units are ok */
if (buf[0] == 'p') {
if (strncmp (buf, "present:", 8) == 0)
sscanf(buf, "present: %4s", present);
} else if (buf[0] == 'c')
sscanf(buf, "charging state: %63s",
charging_state);
else if (buf[0] == 'p')
sscanf(buf, "present rate: %d",
&present_rate);
else if (buf[0] == 'r')
sscanf(buf, "remaining capacity: %d",
&remaining_capacity);
else if (strncmp (buf, "charging state:", 15) == 0)
sscanf(buf, "charging state: %63s", charging_state);
else if (strncmp (buf, "present rate:", 13) == 0)
sscanf(buf, "present rate: %d", &present_rate);
else if (strncmp(buf, "remaining capacity:", 19) == 0)
sscanf(buf, "remaining capacity: %d", &remaining_capacity);
}
/* not present */