* dwmstatus for OpenBSD
       
   URI git clone git://git.codevoid.de/dwmstatus-sdk
   DIR Log
   DIR Files
   DIR Refs
   DIR LICENSE
       ---
   DIR commit 6de79e8d64ba5c8babbe341d198468d083cac7fe
   DIR parent e54e43d8764269eba76639b2317000e7a51b3357
   URI Author: Stefan Hagen <sh+git[at]codevoid[dot]de>
       Date:   Tue, 13 Nov 2018 17:05:59 +0100
       
       Style changes
       
       Diffstat:
         M dwmstatus.c                         |      63 +++++++++----------------------
       
       1 file changed, 17 insertions(+), 46 deletions(-)
       ---
   DIR diff --git a/dwmstatus.c b/dwmstatus.c
       @@ -1,8 +1,5 @@
       -/*
       - * Copy me if you can.
       - * by 20h
       - *
       - */
       +// Copy me if you can.
       +// by 20h
        
        #define _BSD_SOURCE
        #include <unistd.h>
       @@ -34,13 +31,10 @@
        #define BTOMB(x) ((x)*1048576
        #define BTOGB(x) ((x)*1073741824
        
       -char *tzberlin = "Europe/Berlin";
       -
        static Display *dpy;
       +char *tzlocal = "Europe/Berlin";
        
       -char *
       -smprintf(char *fmt, ...)
       -{
       +char * smprintf(char *fmt, ...) {
            va_list fmtargs;
            char *ret;
            int len;
       @@ -62,35 +56,28 @@ smprintf(char *fmt, ...)
            return ret;
        }
        
       -char *
       -getfreespace(const char *path) {
       +char * getfreespace(const char *path) {
            struct statfs vfs;
            statfs(path, &vfs);
            return smprintf("%ld", (vfs.f_bavail * vfs.f_bsize) / 1024 / 1024);
        }
        
       -char *
       -getsysctl(char *input_str) {
       +char * getsysctl(char *input_str) {
            char   *ret_val;
            size_t ret_size;
        
            return "not implemented";
        }
        
       -char *
       -getvolume(char *mixerpath) {
       +char * getvolume(char *mixerpath) {
            return smprintf("N/A");
        } 
        
       -void
       -settz(char *tzname)
       -{
       +void settz(char *tzname) {
            setenv("TZ", tzname, 1);
        }
        
       -char *
       -mktimes(char *fmt, char *tzname)
       -{
       +char * mktimes(char *fmt, char *tzname) {
            char buf[129];
            time_t tim;
            struct tm *timtm;
       @@ -109,16 +96,12 @@ mktimes(char *fmt, char *tzname)
            return smprintf("%s", buf);
        }
        
       -void
       -setstatus(char *str)
       -{
       +void setstatus(char *str) {
            XStoreName(dpy, DefaultRootWindow(dpy), str);
            XSync(dpy, False);
        }
        
       -char *
       -loadavg(void)
       -{
       +char * loadavg(void) {
            double avgs[3];
        
            if (getloadavg(avgs, 3) < 0)
       @@ -128,9 +111,7 @@ loadavg(void)
            return smprintf("%.2f", avgs[0]);
        }
        
       -char *
       -readfile(char *base, char *file)
       -{
       +char * readfile(char *base, char *file) {
            char *path, line[513];
            FILE *fd;
        
       @@ -149,9 +130,7 @@ readfile(char *base, char *file)
            return smprintf("%s", line);
        }
        
       -char *
       -getbattery(char *base)
       -{
       +char * getbattery(char *base) {
            char *co, status;
            int descap, remcap;
        
       @@ -200,11 +179,8 @@ getbattery(char *base)
            return smprintf("%.0f%%%c", ((float)remcap / (float)descap) * 100, status);
        }
        
       -char *
       -gettemperature(char *base, char *sensor)
       -{
       +char * gettemperature(char *base, char *sensor) {
            char *co;
       -
            co = readfile(base, sensor);
            if (co == NULL)
                return smprintf("");
       @@ -221,7 +197,7 @@ void update() {
            // date and time
            char *datetime;
            char *datetime_utc;
       -    datetime = mktimes("%d.%m.%Y %H:%M", tzberlin);
       +    datetime = mktimes("%d.%m.%Y %H:%M", tzlocal);
            datetime_utc = mktimes("%H:%M", "UTC");
        
            // cpu temperature
       @@ -256,18 +232,13 @@ void update() {
        }
        
        
       -// A user might want to force update dwmstatus (for example after a
       -// changing the volume. This can be done by sending signal SIGUSR1.
       -void
       -sig_handler(int signo) {
       +void sig_handler(int signo) {
            if (signo == SIGUSR1)
                update();
                usleep(50000);
        }
        
       -int
       -main(void)
       -{
       +int main(void) {
        
            if (!(dpy = XOpenDisplay(NULL))) {
                fprintf(stderr, "dwmstatus: cannot open display.\n");