* dwmstatus for OpenBSD
       
   URI git clone git://git.codevoid.de/dwmstatus-sdk
   DIR Log
   DIR Files
   DIR Refs
   DIR LICENSE
       ---
   DIR commit dd54568f6cfe3ee35e7b62546ee886ad49136083
   DIR parent 14ed2ae7c332c791e8ba45f391443bf1dd98a050
   URI Author: Stefan Hagen <sh+git[at]codevoid[dot]de>
       Date:   Fri, 23 Nov 2018 19:45:35 +0100
       
       Update 2018-11-23 19:45 OpenBSD/amd64
       
       Diffstat:
         M dwmstatus.c                         |      54 ++++++++++++++++++-------------
       
       1 file changed, 31 insertions(+), 23 deletions(-)
       ---
   DIR diff --git a/dwmstatus.c b/dwmstatus.c
       @@ -24,7 +24,8 @@
        
        // configuration
        #define UPDATE_INTERVAL 10
       -#define LOW_DISKSPACE 10240
       +#define LOW_DISKSPACE_HOME 10240
       +#define LOW_DISKSPACE_ROOT 512
        
        // conversation presets
        #define ZEROCTOC(x) ((x)-2731) / 10
       @@ -190,15 +191,14 @@ char * gettemperature(char *base, char *sensor) {
        
        // update all values and print statusbar
        void update() {
       -    char *status;
       -    char *freespace;
       -    char *volume;
        
       -    // date and time
       -    char *datetime;
       -    char *datetime_utc;
       -    datetime = mktimes("%d.%m.%Y | %H:%M", tzlocal);
       -    datetime_utc = mktimes("%H:%M", "UTC");
       +    // date and time (local)
       +    char *time = mktimes("%H:%M", tzlocal);
       +    char *date = mktimes("%d.%m.%Y", tzlocal);
       +
       +    // date and time (UTC)
       +    char *time_utc = mktimes("%H:%M", "UTC");
       +    char *date_utc = mktimes("%d.%m.%Y", "UTC");
        
            // cpu temperature
            // char *cputemp;
       @@ -211,25 +211,33 @@ void update() {
            // battery  = smprintf("%i", getsysctl("hw.acpi.battery.life"));
        
            // audio volume
       -    volume = getvolume("/dev/mixer");
       +    char *volume = getvolume("/dev/mixer");
        
            // free disk space (root/home)
       -    freespace = getfreespace("/home");
       +    char *freehomespace = getfreespace("/home");
       +    char *freerootspace = getfreespace("/");
        
            // low disk space warning
       -    char *warning = "!!! LOW DISK SPACE WARNING !!! ";
       -    if(atoi(freespace) > LOW_DISKSPACE)
       -        warning = "\0";
       -    status = smprintf("%s💾 %sMB | 🔊 %s | 📶 192.168.0.101 | 🔋 100% | 🔥 %s | 🕐 %s CET @ %s UTC |",
       -            warning, freespace, volume, loadavg(), datetime, datetime_utc);
       -
       -    free(datetime);
       -    free(datetime_utc);
       -
       +    char *warn = "\0";
       +    if(atoi(freehomespace) < LOW_DISKSPACE_HOME)
       +        warn = "     !!! LOW DISK SPACE WARNING @ HOME !!!    |";
       +    if(atoi(freerootspace) < LOW_DISKSPACE_ROOT)
       +        warn = "     !!! LOW DISK SPACE WARNING @ ROOT !!!    |";
       +
       +    // display status
       +    setstatus(smprintf("Volume: %s | Load: %s | %s | %s;"
       +                       "Network: %s | Address: %s |%s /home: %sMB | /: %sMB",
       +                       volume, loadavg(), date, time,
       +                       "PowerMate 2.4GHz", "192.168.2.235", warn, freehomespace, freerootspace));
       +
       +    // free everything up
       +    free(time);
       +    free(time_utc);
       +    free(date);
       +    free(date_utc);
            free(volume);
       -    free(freespace);
       -    setstatus(status);
       -    free(status);
       +    free(freehomespace);
       +    free(freerootspace);
        }