The original displaydate patch no longers work for dwm 5.4. I hacked
it and create a new displaydate patch. Please comment if there is any
issue.
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩104 李白 夜泊牛渚懷古
牛渚西江夜 青天無片雲 登舟望秋月 空憶謝將軍
余亦能高詠 斯人不可聞 明朝挂帆席 楓葉落紛紛
--- 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 <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <X11/cursorfont.h>
@@ -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 */
}