tCustomize strftime(3) format in config.h - spoon - dwm status utility (2f30 fork)
 (HTM) git clone git://src.adamsgaard.dk/spoon
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 315c36f57ada6030ca250fb103df80d8fffadb51
 (DIR) parent f011c092f921514df9cc293a4ab3ffa4ce5ab4cf
 (HTM) Author: lostd <lostd@2f30.org>
       Date:   Thu, 13 Oct 2016 16:52:15 +0200
       
       Customize strftime(3) format in config.h
       
       Thanks to André Alvaro.
       
       Diffstat:
         M config.def.h                        |       2 ++
         M date.c                              |       4 +++-
       
       2 files changed, 5 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/config.def.h b/config.def.h
       t@@ -1,5 +1,7 @@
        /* delay between each update in seconds */
        int delay = 1;
       +/* format for dateread */
       +char timeformat[] = "%a %d %b %Y %H:%M %Z";
        
        struct ent ents[] = {
                /* reorder this if you want */
 (DIR) diff --git a/date.c b/date.c
       t@@ -4,6 +4,8 @@
        #include <stdio.h>
        #include <time.h>
        
       +extern char timeformat[];
       +
        int
        dateread(char *buf, size_t len)
        {
       t@@ -14,6 +16,6 @@ dateread(char *buf, size_t len)
                now = localtime(&t);
                if (now == NULL)
                        return -1;
       -        strftime(buf, len, "%a %d %b %Y %H:%M %Z", now);
       +        strftime(buf, len, timeformat, now);
                return 0;
        }