1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-27 04:32:55 +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; break;
/* let's just hope units are ok */ /* let's just hope units are ok */
if (buf[0] == 'p') { if (strncmp (buf, "present:", 8) == 0)
sscanf(buf, "present: %4s", present); sscanf(buf, "present: %4s", present);
} else if (buf[0] == 'c') else if (strncmp (buf, "charging state:", 15) == 0)
sscanf(buf, "charging state: %63s", sscanf(buf, "charging state: %63s", charging_state);
charging_state); else if (strncmp (buf, "present rate:", 13) == 0)
else if (buf[0] == 'p') sscanf(buf, "present rate: %d", &present_rate);
sscanf(buf, "present rate: %d", else if (strncmp(buf, "remaining capacity:", 19) == 0)
&present_rate); sscanf(buf, "remaining capacity: %d", &remaining_capacity);
else if (buf[0] == 'r')
sscanf(buf, "remaining capacity: %d",
&remaining_capacity);
} }
/* not present */ /* not present */