From 3471ff39f865a450444774237c435bceaaac1c01 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 26 Nov 2011 18:26:38 +0000 Subject: battery: implement "path" option for batteries with non-standard paths --- src/print_battery_info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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; -- cgit v1.2.3