* dwmstatus for OpenBSD
       
   URI git clone git://git.codevoid.de/dwmstatus-sdk
   DIR Log
   DIR Files
   DIR Refs
   DIR LICENSE
       ---
   DIR commit ab367a96f64c78ed3677259b3b86ba96e2307d50
   DIR parent 0c1dd4b7655776b467d96a77f13ff844302379ef
   URI Author: Stefan Hagen <sh+git[at]codevoid[dot]de>
       Date:   Tue, 13 Nov 2018 14:48:13 +0100
       
       Bye Bye FreeBSD, Hello OpenBSD.
       
       Diffstat:
         M dwmstatus.c                         |      66 +++++++++----------------------
       
       1 file changed, 19 insertions(+), 47 deletions(-)
       ---
   DIR diff --git a/dwmstatus.c b/dwmstatus.c
       @@ -19,17 +19,11 @@
        #include <sys/wait.h>
        #include <signal.h>
        #include <fcntl.h>
       -#include <sys/soundcard.h>
        
        #include <X11/Xlib.h>
        
       -// getfreespace
       -#ifdef __FreeBSD__
        #include <sys/param.h> // freebsd
        #include <sys/mount.h> // freebsd
       -#else
       -#include <sys/vfs.h>
       -#endif
        
        // configuration
        #define UPDATE_INTERVAL 10
       @@ -268,63 +262,41 @@ gettemperature(char *base, char *sensor)
        // update all values and print statusbar
        void update() {
            char *status;
       +    char *freespace;
       +    char *volume;
        
       -#ifdef __FreeBSD__
       +    // date and time
            char *datetime;
       -    char *cputemp;
       -    char *cpufreq;
       -    char *battery;
       -    char *volume;
       -    char *freespace;
       +    char *datetime_utc;
       +    datetime = mktimes("%d.%m.%Y %H:%M", tzberlin);
       +    datetime_utc = mktimes("%H:%M", "UTC");
       +
            // cpu temperature
       -    cputemp  = smprintf("%i", ZEROCTOC((int)getsysctl("hw.acpi.thermal.tz0.temperature")));
       +    // char *cputemp;
       +    // cputemp  = smprintf("%i", ZEROCTOC((int)getsysctl("hw.acpi.thermal.tz0.temperature")));
        
            // cpu frequency
       -    cpufreq  = smprintf("%i", getsysctl("dev.cpu.0.freq"));
       +    // cpufreq  = smprintf("%i", getsysctl("dev.cpu.0.freq"));
        
            // battery
       -    battery  = smprintf("%i", getsysctl("hw.acpi.battery.life"));
       +    // battery  = smprintf("%i", getsysctl("hw.acpi.battery.life"));
        
            // audio volume
            volume = getvolume("/dev/mixer");
        
       -    // IP + (lan speed / wlan ssid)
       -    // TBD
       -
            // free disk space (root/home)
       -    freespace = getfreespace("/");
       +    freespace = getfreespace("/home");
        
       -    // date and time
       -    datetime = mktimes("%d.%m.%Y %H:%M", tzberlin);
       +    // low disk space warning
       +    char warning[32];
       +    if(atoi(freespace) < LOW_DISKSPACE)
       +        strncpy(warning, "!!! LOW DISK SPACE WARNING !!! \0", sizeof(warning));
       +    status   = smprintf("%s%sMB | LOAD:%s | %sCET @ %sUTC", warning, freespace, loadavg(), datetime, datetime_utc);
        
       -    // assemble and display
       -    if(atoi(freespace) > LOW_DISKSPACE) {
       -        status   = smprintf("/:%sMB LOAD:%s TEMP:%s°C FREQ:%sMhz BAT:%s%% VOL:%s | %s ", freespace, loadavg(), cputemp, cpufreq, battery, volume, datetime);
       -    } else {
       -        status   = smprintf("!!! LOW DISK SPACE WARNING !!! /:%sMB LOAD:%s TEMP:%s°C FREQ:%sMhz BAT:%s%% VOL:%s | %s ", freespace, loadavg(), cputemp, cpufreq, battery, volume, datetime);
       -    }
       -    free(freespace);
       -    free(volume);
       -    free(battery);
       -    free(cputemp);
       -    free(cpufreq);
       -    free(datetime);
       -#else
       -    char *datetime;
       -    char *freespace;
       -    // date and time
       -    datetime = mktimes("%d.%m.%Y %H:%M", tzberlin);
       -    // free disk space (root/home)
       -    freespace = getfreespace("/");
       -    if(atoi(freespace) > LOW_DISKSPACE) {
       -        status   = smprintf("/:%sMB LOAD:%s | %s ", freespace, loadavg(), datetime);
       -    } else {
       -        status   = smprintf("!!! LOW DISK SPACE WARNING !!! /:%sMB LOAD:%s | %s ", freespace, loadavg(), datetime);
       -    }
            free(datetime);
       +    free(datetime_utc);
       +    free(volume);
            free(freespace);
       -#endif
       -
            setstatus(status);
            free(status);
        }