X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/41deabf2ec1ad5f10851421cfbaf17023e7de05f..e43c3a16f06ccd0c35814e8b47a6f30e81f9c981:/components/battery.c diff --git a/components/battery.c b/components/battery.c index 327d576..e997e4c 100644 --- a/components/battery.c +++ b/components/battery.c @@ -20,18 +20,6 @@ bprintf("%d", perc) : NULL; } - const char * - battery_power(const char *bat) - { - int watts; - char path[PATH_MAX]; - - snprintf(path, sizeof(path), "%s%s%s", "/sys/class/power_supply/", - bat, "/power_now"); - return (pscanf(path, "%i", &watts) == 1) ? - bprintf("%d", (watts + 500000) / 1000000) : NULL; - } - const char * battery_state(const char *bat) { @@ -42,7 +30,6 @@ { "Charging", "+" }, { "Discharging", "-" }, { "Full", "=" }, - { "Unknown", "/" }, }; size_t i; char path[PATH_MAX], state[12]; @@ -101,7 +88,6 @@ } map[] = { { APM_AC_ON, "+" }, { APM_AC_OFF, "-" }, - { APM_AC_UNKNOWN, "/" }, }; fd = open("/dev/apm", O_RDONLY);