commit 30b2fab46c28872b36127bfb20aa727048485be2
parent 7c47d03e8c364214598b5e3df0135d51526e23a3
Author: bsandro <brian.drosan@gmail.com>
Date: Sat, 5 Feb 2022 21:24:33 +0200
test commit to see if newly unwrapped openbsd server works properly
Diffstat:
M | dwmstatus.c | | | 51 | --------------------------------------------------- |
1 file changed, 0 insertions(+), 51 deletions(-)
diff --git a/dwmstatus.c b/dwmstatus.c
@@ -156,57 +156,6 @@ cpufreq(void)
}
char *
-getbattery(char *base)
-{
- char *co, status;
- int descap, remcap;
-
- descap = -1;
- remcap = -1;
-
- co = readfile(base, "present");
- if (co == NULL)
- return smprintf("");
- if (co[0] != '1') {
- free(co);
- return smprintf("not present");
- }
- free(co);
-
- co = readfile(base, "charge_full_design");
- if (co == NULL) {
- co = readfile(base, "energy_full_design");
- if (co == NULL)
- return smprintf("");
- }
- sscanf(co, "%d", &descap);
- free(co);
-
- co = readfile(base, "charge_now");
- if (co == NULL) {
- co = readfile(base, "energy_now");
- if (co == NULL)
- return smprintf("");
- }
- sscanf(co, "%d", &remcap);
- free(co);
-
- co = readfile(base, "status");
- if (!strncmp(co, "Discharging", 11)) {
- status = '-';
- } else if(!strncmp(co, "Charging", 8)) {
- status = '+';
- } else {
- status = '?';
- }
-
- if (remcap < 0 || descap < 0)
- return smprintf("invalid");
-
- return smprintf("%.0f%%%c", ((float)remcap / (float)descap) * 100, status);
-}
-
-char *
gettemperature()
{
int mib[5];