New custom config + port display date patch
3 files changed, 164 insertions(+), 0 deletions(-)

A => custom_config
A => display_date
M series
A => custom_config +73 -0
@@ 0,0 1,73 @@ 
+# HG changeset patch
+# Parent 52cda53b5610b797a9e653a57da313e684e81902
+
+diff -r 52cda53b5610 config.def.h
+--- a/config.def.h	Wed Feb 04 09:59:51 2015 -0800
++++ b/config.def.h	Thu Feb 05 10:22:10 2015 -0800
+@@ -2,12 +2,12 @@
+ 
+ /* appearance */
+ static const char font[]            = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
+-static const char normbordercolor[] = "#444444";
+-static const char normbgcolor[]     = "#222222";
+-static const char normfgcolor[]     = "#bbbbbb";
+-static const char selbordercolor[]  = "#005577";
+-static const char selbgcolor[]      = "#005577";
+-static const char selfgcolor[]      = "#eeeeee";
++static const char normbordercolor[] = "#003000";
++static const char normbgcolor[]     = "#445044";
++static const char normfgcolor[]     = "#aaaaaa";
++static const char selbordercolor[]  = "#ff0000";
++static const char selbgcolor[]      = "#006600";
++static const char selfgcolor[]      = "#aaaaaa";
+ static const unsigned int borderpx  = 1;        /* border pixel of windows */
+ static const unsigned int snap      = 32;       /* snap pixel */
+ static const Bool showbar           = True;     /* False means no bar */
+@@ -23,11 +23,12 @@
+ 	 */
+ 	/* class      instance    title       tags mask     isfloating   monitor */
+ 	{ "Gimp",     NULL,       NULL,       0,            True,        -1 },
+-	{ "Firefox",  NULL,       NULL,       1 << 8,       False,       -1 },
++	{ "Firefox",  NULL,       NULL,       1 << 2,       False,       -1 },
++	{ "Chromium-browser", NULL, NULL,     1 << 2,       False,       -1 },
+ };
+ 
+ /* layout(s) */
+-static const float mfact      = 0.55; /* factor of master area size [0.05..0.95] */
++static const float mfact      = 0.5; /* factor of master area size [0.05..0.95] */
+ static const int nmaster      = 1;    /* number of clients in master area */
+ static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
+ 
+@@ -51,14 +52,14 @@
+ 
+ /* commands */
+ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
+-static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
+-static const char *termcmd[]  = { "st", NULL };
++static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
++static const char *termcmd[]  = { "urxvt", NULL };
+ 
+ static Key keys[] = {
+ 	/* modifier                     key        function        argument */
+ 	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
+ 	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
+-	{ MODKEY,                       XK_b,      togglebar,      {0} },
++	{ MODKEY|ShiftMask,             XK_b,      togglebar,      {0} },
+ 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
+ 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
+ 	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
+@@ -68,11 +69,10 @@
+ 	{ MODKEY,                       XK_Return, zoom,           {0} },
+ 	{ MODKEY,                       XK_Tab,    view,           {0} },
+ 	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
+-	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
+-	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
+-	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
++	{ MODKEY|ShiftMask,             XK_t,      setlayout,      {.v = &layouts[0]} },
++	{ MODKEY|ShiftMask,             XK_f,      setlayout,      {.v = &layouts[1]} },
++	{ MODKEY|ShiftMask,             XK_m,      setlayout,      {.v = &layouts[2]} },
+ 	{ MODKEY,                       XK_space,  setlayout,      {0} },
+-	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
+ 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
+ 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
+ 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },

          
A => display_date +89 -0
@@ 0,0 1,89 @@ 
+# HG changeset patch
+# Parent 48aefc89ece183ba4707000486f714a93d7f97e5
+
+diff -r 48aefc89ece1 dwm.c
+--- a/dwm.c	Thu Feb 05 10:22:10 2015 -0800
++++ b/dwm.c	Thu Feb 05 10:27:36 2015 -0800
+@@ -28,8 +28,11 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <time.h>
++#include <err.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
++#include <sys/select.h>
+ #include <X11/cursorfont.h>
+ #include <X11/keysym.h>
+ #include <X11/Xatom.h>
+@@ -1199,9 +1202,7 @@
+ 	Window trans;
+ 	XPropertyEvent *ev = &e->xproperty;
+ 
+-	if((ev->window == root) && (ev->atom == XA_WM_NAME))
+-		updatestatus();
+-	else if(ev->state == PropertyDelete)
++	if(ev->state == PropertyDelete)
+ 		return; /* ignore */
+ 	else if((c = wintoclient(ev->window))) {
+ 		switch(ev->atom) {
+@@ -1349,12 +1350,34 @@
+ 
+ void
+ run(void) {
+-	XEvent ev;
++	int xfd = ConnectionNumber(dpy);
++
+ 	/* main event loop */
+ 	XSync(dpy, False);
+-	while(running && !XNextEvent(dpy, &ev))
+-		if(handler[ev.type])
+-			handler[ev.type](&ev); /* call handler */
++	while(running) {
++		struct timeval timeout = {.tv_sec = 1, .tv_usec = 0};
++		fd_set fds;
++
++		FD_ZERO(&fds);
++		FD_SET(xfd, &fds);
++
++		if (select(xfd + 1, &fds, NULL, NULL, &timeout) == -1) {
++			if (errno == EINTR)
++				continue;
++			err(EXIT_FAILURE, NULL);
++		}
++
++		/* Process all X events */
++		while(XPending(dpy)) {
++			XEvent ev;
++
++			XNextEvent(dpy, &ev);
++			if(handler[ev.type])
++				(handler[ev.type])(&ev); /* call handler */
++		}
++		updatestatus();
++		XFlush(dpy);
++	}
+ }
+ 
+ void
+@@ -1932,9 +1955,17 @@
+ 
+ void
+ updatestatus(void) {
+-	if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
+-		strcpy(stext, "dwm-"VERSION);
+-	drawbar(selmon);
++	static time_t last = 0;
++	time_t now = time(NULL);
++
++	if (now > last) {
++		last = now;
++		strftime(stext, sizeof stext - 1, "%F %R", localtime(&now));
++		/* Depending on the implementation of strftime, status_text might not be
++		 * null terminated. */
++		stext[sizeof stext - 1] = '\0';
++		drawbar(selmon);
++	}
+ }
+ 
+ void

          
M series +2 -0
@@ 1,1 1,3 @@ 
 config_dep
+custom_config
+display_date