--- dwm2/dwm.c 2009-02-09 11:53:19.000000000 +0800 +++ dwm/dwm.c 2009-02-09 11:56:07.000000000 +0800 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -1204,6 +1205,16 @@ /* main event loop */ XSync(dpy, False); while(running && !XNextEvent(dpy, &ev)) { + { + time_t t; + + t = time(NULL); + strftime(stext, sizeof stext - 1, "%a %e %b, %I:%M%p", localtime(&t)); + /* Depending on the implementation of strftime, stext might + * not be null terminated. */ + stext[sizeof stext - 1] = '\0'; + drawbar(); + } if(handler[ev.type]) (handler[ev.type])(&ev); /* call handler */ }