diff options
Diffstat (limited to 'dwmstatus')
-rw-r--r-- | dwmstatus/custom.diff | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/dwmstatus/custom.diff b/dwmstatus/custom.diff new file mode 100644 index 0000000..83faaba --- /dev/null +++ b/dwmstatus/custom.diff @@ -0,0 +1,75 @@ +diff --git a/dwmstatus.c b/dwmstatus.c +index d2a4b03..cbb5f6c 100644 +--- a/dwmstatus.c ++++ b/dwmstatus.c +@@ -17,8 +17,6 @@ + + #include <X11/Xlib.h> + +-char *tzargentina = "America/Buenos_Aires"; +-char *tzutc = "UTC"; + char *tzberlin = "Europe/Berlin"; + + static Display *dpy; +@@ -89,7 +87,7 @@ loadavg(void) + if (getloadavg(avgs, 3) < 0) + return smprintf(""); + +- return smprintf("%.2f %.2f %.2f", avgs[0], avgs[1], avgs[2]); ++ return smprintf("%.2f", avgs[1]); + } + + char * +@@ -155,7 +153,7 @@ getbattery(char *base) + } else if(!strncmp(co, "Charging", 8)) { + status = '+'; + } else { +- status = '?'; ++ status = '\0'; + } + + if (remcap < 0 || descap < 0) +@@ -181,11 +179,7 @@ main(void) + char *status; + char *avgs; + char *bat; +- char *bat1; +- char *tmar; +- char *tmutc; + char *tmbln; +- char *t0, *t1, *t2; + + if (!(dpy = XOpenDisplay(NULL))) { + fprintf(stderr, "dwmstatus: cannot open display.\n"); +@@ -195,27 +189,14 @@ main(void) + for (;;sleep(60)) { + avgs = loadavg(); + bat = getbattery("/sys/class/power_supply/BAT0"); +- bat1 = getbattery("/sys/class/power_supply/BAT1"); +- tmar = mktimes("%H:%M", tzargentina); +- tmutc = mktimes("%H:%M", tzutc); +- tmbln = mktimes("KW %W %a %d %b %H:%M %Z %Y", tzberlin); +- t0 = gettemperature("/sys/devices/virtual/hwmon/hwmon0", "temp1_input"); +- t1 = gettemperature("/sys/devices/virtual/hwmon/hwmon2", "temp1_input"); +- t2 = gettemperature("/sys/devices/virtual/hwmon/hwmon4", "temp1_input"); +- +- status = smprintf("T:%s|%s|%s L:%s B:%s|%s A:%s U:%s %s", +- t0, t1, t2, avgs, bat, bat1, tmar, tmutc, +- tmbln); ++ tmbln = mktimes("%a %d %b %H:%M", tzberlin); ++ ++ status = smprintf("%s %s %s", ++ avgs, bat, tmbln); + setstatus(status); + +- free(t0); +- free(t1); +- free(t2); + free(avgs); + free(bat); +- free(bat1); +- free(tmar); +- free(tmutc); + free(tmbln); + free(status); + } |