summaryrefslogtreecommitdiff
path: root/src/print_battery_info.c
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2011-11-26 18:26:38 +0000
committerMichael Stapelberg <michael@stapelberg.de>2011-11-26 18:26:38 +0000
commit3471ff39f865a450444774237c435bceaaac1c01 (patch)
tree1a2a09adfd1a2b7fa01c873d0b899c5481ee6d73 /src/print_battery_info.c
parent40012ed7c62f72f97a183bf72e80c137426d8791 (diff)
battery: implement "path" option for batteries with non-standard paths
Diffstat (limited to 'src/print_battery_info.c')
-rw-r--r--src/print_battery_info.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/print_battery_info.c b/src/print_battery_info.c
index 36de3c8..6ee8989 100644
--- a/src/print_battery_info.c
+++ b/src/print_battery_info.c
@@ -17,7 +17,7 @@
* worn off your battery is.
*
*/
-void print_battery_info(int number, const char *format, bool last_full_capacity) {
+void print_battery_info(int number, const char *path, const char *format, bool last_full_capacity) {
time_t empty_time;
struct tm *empty_tm;
char buf[1024];
@@ -38,7 +38,7 @@ void print_battery_info(int number, const char *format, bool last_full_capacity)
#if defined(LINUX)
static char batpath[512];
- sprintf(batpath, "/sys/class/power_supply/BAT%d/uevent", number);
+ sprintf(batpath, path, number);
if (!slurp(batpath, buf, sizeof(buf))) {
printf("No battery");
return;