Commits

Julien Jehannet  committed f90aa99

refresh dwm patches

  • Participants
  • Parent commits 71c63e0

Comments (0)

Files changed (10)

+# HG changeset patch
+# Parent c532bf49341539897f2edb6c2b27a4f2858a75bc
+diff --git a/config.h b/config.h
+--- a/config.h
++++ b/config.h
+@@ -22,11 +22,12 @@ static const Rule rules[] = {
+ 	/* class      instance    title       tags mask     isfloating   monitor */
+ 	{ "Gimp",     NULL,       NULL,       0,            True,        -1 },
+ 	{ "Firefox",  NULL,       NULL,       1 << 8,       False,       -1 },
+ 	{ "QEMU",     NULL,       NULL,       4,            True,        -1 },
+ 	{ "Xeyes",    NULL,       NULL,       1 << 9,       False,       -1 },
+-	{ NULL,       NULL,       "panel",    0,            False,       -1 },
++	{ "dzen",     NULL,       NULL,       -1,           False,       -1 },
++	{ "panel",    NULL,       "panel",    -1,           False,       -1 },
+ };
+ 
+ /* layout(s) */
+ static const float mfact      = 0.62; /* factor of master area size [0.05..0.95] */
+ static const Bool resizehints = True; /* True means respect size hints in tiled resizals */

File dwm-5.7.2-urgentborder.diff

 # HG changeset patch
-# Parent e80f6b1d222ec7a593733ef5c766923cd69d5451
+# Parent a4e446f38013b8b3fabede6481fdad68fea47b2c
 # Date 1294700804 -3600
 # User Julien Jehannet <julien@smaf.org>
 
-
-diff --git a/config.def.h b/config.def.h
---- a/config.def.h
-+++ b/config.def.h
-@@ -8,6 +8,7 @@ static const char normfgcolor[]     = "#
- static const char selbordercolor[]  = "#0066ff";
- static const char selbgcolor[]      = "#0066ff";
- static const char selfgcolor[]      = "#ffffff";
-+static const char urgbordercolor[]  = "#ff0000";
- 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 */
 diff --git a/config.h b/config.h
 --- a/config.h
 +++ b/config.h
-@@ -8,6 +8,7 @@ static const char normfgcolor[]     = "#
+@@ -6,10 +6,11 @@ static const char normbordercolor[] = "#
+ static const char normbgcolor[]     = "#111111";
+ static const char normfgcolor[]     = "#888888";
  static const char selbordercolor[]  = "#ffff00";
  static const char selbgcolor[]      = "#333333";
  static const char selfgcolor[]      = "#ffff00";
  static const unsigned int borderpx  = 1;        /* border pixel of windows */
  static const unsigned int snap      = 4;        /* snap pixel */
  static const Bool showbar           = True;     /* False means no bar */
+ static const Bool topbar            = True;     /* False means bottom bar */
+ 
 diff --git a/dwm.c b/dwm.c
 --- a/dwm.c
 +++ b/dwm.c
-@@ -100,6 +100,7 @@ typedef struct {
+@@ -101,10 +101,11 @@ struct Client {
+ 
+ typedef struct {
  	int x, y, w, h;
  	unsigned long norm[ColLast];
  	unsigned long sel[ColLast];
  	Drawable drawable;
  	GC gc;
  	struct {
-@@ -1555,6 +1556,9 @@ setup(void) {
+ 		int ascent;
+ 		int descent;
+@@ -1639,10 +1640,13 @@ setup(void) {
+ 	dc.norm[ColBG] = getcolor(normbgcolor);
+ 	dc.norm[ColFG] = getcolor(normfgcolor);
  	dc.sel[ColBorder] = getcolor(selbordercolor);
  	dc.sel[ColBG] = getcolor(selbgcolor);
  	dc.sel[ColFG] = getcolor(selfgcolor);
  	dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen));
  	dc.gc = XCreateGC(dpy, root, 0, NULL);
  	XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
-@@ -1956,8 +1960,11 @@ updatewmhints(Client *c) {
+ 	if(!dc.font.set)
+ 		XSetFont(dpy, dc.gc, dc.font.xfont->fid);
+@@ -2072,12 +2076,15 @@ updatewmhints(Client *c) {
+ 	if((wmh = XGetWMHints(dpy, c->win))) {
+ 		if(c == selmon->sel && wmh->flags & XUrgencyHint) {
  			wmh->flags &= ~XUrgencyHint;
  			XSetWMHints(dpy, c->win, wmh);
  		}
 +			if (c->isurgent)
 +				XSetWindowBorder(dpy, c->win, dc.urg[ColBorder]);
 +		}
+ 		if(wmh->flags & InputHint)
+ 			c->neverfocus = !wmh->input;
+ 		else
+ 			c->neverfocus = False;
  		XFree(wmh);
- 	}
- }

File dwm-5.9-bstack.diff

 # HG changeset patch
-# Parent 58ab08db498e0bf2ae2deffe8b471362758e4ecc
+# Parent 00e19065124a215008a9561d3ddab69b156ece8c
 # Date 1294784085 -3600
 # User Julien Jehannet <julien@smaf.org>
 
 diff --git a/config.def.h b/config.def.h
 --- a/config.def.h
 +++ b/config.def.h
-@@ -26,11 +26,15 @@ static const Rule rules[] = {
+@@ -29,15 +29,19 @@ static const Rule rules[] = {
+ /* layout(s) */
  static const float mfact      = 0.55; /* 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 */
  
 +#include "bstack.c"
  };
  
  /* key definitions */
+ #define MODKEY Mod1Mask
+ #define TAGKEYS(KEY,TAG) \
 diff --git a/config.h b/config.h
 --- a/config.h
 +++ b/config.h
-@@ -29,11 +29,15 @@ static const Rule rules[] = {
- static const float mfact      = 0.62; /* factor of master area size [0.05..0.95] */
+@@ -32,15 +32,19 @@ static const Rule rules[] = {
+ /* layout(s) */
+ static const float mfact      = 0.55; /* 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 */
  
 +#include "bstack.c"
  };
  
  /* key definitions */
-@@ -71,9 +75,9 @@ static Key keys[] = {
+ #define MODKEY Mod4Mask
+ #define TAGKEYS(KEY,TAG) \
+@@ -80,13 +84,13 @@ static Key keys[] = {
+ 	{ MODKEY|ControlMask,           XK_Left,                zoom,           {0} },
+ 	{ MODKEY|ControlMask,           XK_Right,               zoom,           {0} },
  	{ MODKEY|ControlMask,           XK_Return,              zoom,           {0} },
  	{ MODKEY,                       XK_Tab,                 view,           {0} },
  	{ MODKEY,                       XK_space,               zoom,           {0} },
  	{ MODKEY,                       XK_f,                   setlayout,      {.v = &layouts[2]} },
  	{ MODKEY|ControlMask,           XK_f,                   setlayout,      {.v = &layouts[1]} },
  	{ MODKEY,                       XK_d,                   setlayout,      {.v = &layouts[0]} },
+ 	{ MODKEY,                       XK_t,                   setlayout,      {.v = &layouts[0]} },
+ 	{ MODKEY|ShiftMask,             XK_f,                   togglefloating, {0} },

File dwm-6.0-systray.diff

+Author: Jan Christoph Ebersbach <jceb@e-jc.de>, inspired by http://code.google.com/p/dwm-plus
+URL: http://dwm.suckless.org/patches/systray
+Implements a system tray for dwm.
+
+diff --git a/config.def.h b/config.def.h
+--- a/config.def.h
++++ b/config.def.h
+@@ -8,10 +8,12 @@ static const char normfgcolor[]     = "#
+ static const char selbordercolor[]  = "#005577";
+ static const char selbgcolor[]      = "#005577";
+ static const char selfgcolor[]      = "#eeeeee";
+ static const unsigned int borderpx  = 1;        /* border pixel of windows */
+ static const unsigned int snap      = 32;       /* snap pixel */
++static const unsigned int systrayspacing = 2;   /* systray spacing */
++static const Bool showsystray       = True;     /* False means no systray */
+ static const Bool showbar           = True;     /* False means no bar */
+ static const Bool topbar            = True;     /* False means bottom bar */
+ static const Bool viewontag         = True;     /* Switch view on tag switch */
+ 
+ /* tagging */
+diff --git a/config.h b/config.h
+--- a/config.h
++++ b/config.h
+@@ -9,10 +9,12 @@ static const char selbordercolor[]  = "#
+ static const char selbgcolor[]      = "#333333";
+ static const char selfgcolor[]      = "#ffff00";
+ static const char urgbordercolor[]  = "#ff0000";
+ static const unsigned int borderpx  = 1;        /* border pixel of windows */
+ static const unsigned int snap      = 4;        /* snap pixel */
++static const unsigned int systrayspacing = 2;   /* systray spacing */
++static const Bool showsystray       = True;     /* False means no systray */
+ static const Bool showbar           = True;     /* False means no bar */
+ static const Bool topbar            = True;     /* False means bottom bar */
+ static const Bool viewontag         = True;     /* Switch view on tag switch */
+ 
+ /* tagging */
+diff --git a/dwm.c b/dwm.c
+--- a/dwm.c
++++ b/dwm.c
+@@ -55,16 +55,19 @@
+ #define HEIGHT(X)               ((X)->h + 2 * (X)->bw)
+ #define TAGMASK                 ((1 << LENGTH(tags)) - 1)
+ #define TEXTW(X)                (textnw(X, strlen(X)) + dc.font.height)
+ #define ISPANEL(X)              (ISVISIBLE(X) && (strcmp("panel", X->name) == 0))
+ 
++#define SYSTEM_TRAY_REQUEST_DOCK    0
++#define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0
++
+ /* enums */
+ enum { CurNormal, CurResize, CurMove, CurLast };        /* cursor */
+ enum { ColBorder, ColFG, ColBG, ColLast };              /* color */
+-enum { NetSupported, NetWMName, NetWMState,
+-       NetWMFullscreen, NetActiveWindow, NetWMWindowType,
+-       NetWMWindowTypeDialog, NetClientList, NetLast };     /* EWMH atoms */
++enum { NetSupported, NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation,
++       NetWMName, NetWMState, NetWMFullscreen, NetActiveWindow,
++       NetWMWindowType, NetWMWindowTypeDialog, NetClientList, NetLast };     /* EWMH atoms */
+ enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
+ enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
+        ClkClientWin, ClkRootWin, ClkLast };             /* clicks */
+ 
+ typedef union {
+@@ -155,10 +158,23 @@ typedef struct {
+ 	unsigned int tags;
+ 	Bool isfloating;
+ 	int monitor;
+ } Rule;
+ 
++typedef struct SystrayIcon SystrayIcon;
++struct SystrayIcon {
++	Window win;
++	XRectangle geo;
++	SystrayIcon *next;
++};
++
++typedef struct Systray   Systray;
++struct Systray {
++	Window win;
++	SystrayIcon *icons;
++};
++
+ /* function declarations */
+ static void applyrules(Client *c);
+ static Bool applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool interact);
+ static void arrange(Monitor *m);
+ static void arrangemon(Monitor *m);
+@@ -191,10 +207,11 @@ static void focusin(XEvent *e);
+ static void focusmon(const Arg *arg);
+ static void focusstack(const Arg *arg);
+ static unsigned long getcolor(const char *colstr);
+ static Bool getrootptr(int *x, int *y);
+ static long getstate(Window w);
++unsigned int getsystraywidth();
+ static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size);
+ static void grabbuttons(Client *c, Bool focused);
+ static void grabkeys(void);
+ static void incnmaster(const Arg *arg);
+ static void initfont(const char *fontstr);
+@@ -209,11 +226,13 @@ static void movemouse(const Arg *arg);
+ static Client *nexttiled(Client *c);
+ static void pop(Client *);
+ static void propertynotify(XEvent *e);
+ //static void quit(const Arg *arg);
+ static Monitor *recttomon(int x, int y, int w, int h);
++static void removesystrayicon(SystrayIcon *i);
+ static void resize(Client *c, int x, int y, int w, int h, Bool interact);
++static void resizebarwin(Monitor *m);
+ static void resizeclient(Client *c, int x, int y, int w, int h);
+ static void resizemouse(const Arg *arg);
+ static void restack(Monitor *m);
+ static void run(void);
+ static void scan(void);
+@@ -244,22 +263,26 @@ static void updatebarpos(Monitor *m);
+ static void updatebars(void);
+ static void updateclientlist(void);
+ static void updatenumlockmask(void);
+ static void updatesizehints(Client *c);
+ static void updatestatus(void);
++static void updatesystray();
+ static void updatewindowtype(Client *c);
+ static void updatetitle(Client *c);
+ static void updatewmhints(Client *c);
+ static void view(const Arg *arg);
+ static Client *wintoclient(Window w);
+ static Monitor *wintomon(Window w);
++static SystrayIcon *wintosystrayicon(Window w);
+ static int xerror(Display *dpy, XErrorEvent *ee);
+ static int xerrordummy(Display *dpy, XErrorEvent *ee);
+ static int xerrorstart(Display *dpy, XErrorEvent *ee);
+ static void zoom(const Arg *arg);
+ 
+ /* variables */
++static Systray *systray = NULL;
++static unsigned long systrayorientation = _NET_SYSTEM_TRAY_ORIENTATION_HORZ;
+ static const char broken[] = "broken";
+ static char stext[256];
+ static int screen;
+ static int sw, sh;           /* X display screen geometry width, height */
+ static int bh, blw = 0;      /* bar geometry */
+@@ -535,13 +558,41 @@ clearurgent(Client *c) {
+ 	XFree(wmh);
+ }
+ 
+ void
+ clientmessage(XEvent *e) {
++	XWindowAttributes *wa;
+ 	XClientMessageEvent *cme = &e->xclient;
+ 	Client *c = wintoclient(cme->window);
++	SystrayIcon *i;
+ 
++	/* add systray icons */
++	if(cme->message_type == netatom[NetSystemTrayOP]) {
++		if(cme->data.l[1] == SYSTEM_TRAY_REQUEST_DOCK) {
++			if(!(i = (SystrayIcon *)calloc(1, sizeof(SystrayIcon))))
++				die("fatal: could not malloc() %u bytes\n", sizeof(SystrayIcon));
++			if(!(wa = (XWindowAttributes *)calloc(1, sizeof(XWindowAttributes))))
++				die("fatal: could not malloc() %u bytes\n", sizeof(XWindowAttributes));
++			i->win = cme->data.l[2];
++			i->next = systray->icons;
++			systray->icons = i;
++			/* deal with tray icons that have rectangle proportions */
++			XGetWindowAttributes(dpy, i->win, wa);
++			i->geo.height = bh;
++			if(wa->width == wa->height)
++				i->geo.width = bh;
++			else
++				i->geo.width = (int) (bh * (wa->width / wa->height));
++			XAddToSaveSet(dpy, i->win);
++			XSelectInput(dpy, i->win, StructureNotifyMask | ResizeRedirectMask
++					| PointerMotionMask | PointerMotionHintMask
++					| PropertyChangeMask| EnterWindowMask | FocusChangeMask);
++			XReparentWindow(dpy, i->win, systray->win, 0, 0);
++			XMapRaised(dpy, i->win);
++			updatesystray();
++		}
++	}
+ 	if(!c)
+ 		return;
+ 	if(cme->message_type == netatom[NetWMState]) {
+ 		if(cme->data.l[1] == netatom[NetWMFullscreen] || cme->data.l[2] == netatom[NetWMFullscreen])
+ 			setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD    */
+@@ -588,11 +639,11 @@ configurenotify(XEvent *e) {
+ 			if(dc.drawable != 0)
+ 				XFreePixmap(dpy, dc.drawable);
+ 			dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
+ 			updatebars();
+ 			for(m = mons; m; m = m->next)
+-				XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
++				resizebarwin(m);
+ 			focus(NULL);
+ 			arrange(NULL);
+ 		}
+ 	}
+ }
+@@ -668,14 +719,19 @@ createmon(void) {
+ }
+ 
+ void
+ destroynotify(XEvent *e) {
+ 	Client *c;
++	SystrayIcon *i;
+ 	XDestroyWindowEvent *ev = &e->xdestroywindow;
+ 
+ 	if((c = wintoclient(ev->window)))
+ 		unmanage(c, True);
++	else if((i = wintosystrayicon(ev->window))) {
++		removesystrayicon(i);
++		updatesystray();
++	}
+ }
+ 
+ void
+ detach(Client *c) {
+ 	Client **tc;
+@@ -729,10 +785,11 @@ drawbar(Monitor *m) {
+ 	unsigned long *col;
+ 	unsigned int a= 0, s= 0;
+ 	char posbuf[10];
+ 	Client *c;
+ 
++	resizebarwin(m);
+ 	for(c = m->clients; c; c = c->next) {
+ 		occ |= c->tags;
+ 		if(c->isurgent)
+ 			urg |= c->tags;
+ 	}
+@@ -762,10 +819,13 @@ drawbar(Monitor *m) {
+ 	}
+ 	
+ 	if(m == selmon) { /* status is only drawn on selected monitor */
+ 		dc.w = TEXTW(stext);
+ 		dc.x = m->ww - dc.w;
++		if(showsystray && m == selmon) {
++			dc.x -= getsystraywidth();
++		}
+ 		if(dc.x < x) {
+ 			dc.x = x;
+ 			dc.w = m->ww - x;
+ 		}
+ 		drawtext(stext, dc.norm, False);
+@@ -883,10 +943,11 @@ focus(Client *c) {
+ 		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+ 		XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
+ 	}
+ 	selmon->sel = c;
+ 	drawbars();
++	updatesystray();
+ }
+ 
+ void
+ focusatomchange() {
+ 	int format, status;
+@@ -1011,10 +1072,18 @@ getstate(Window w) {
+ 		result = *p;
+ 	XFree(p);
+ 	return result;
+ }
+ 
++unsigned int
++getsystraywidth() {
++	unsigned int w = 0;
++	SystrayIcon *i;
++	for(i = systray->icons; i; w += i->geo.width + systrayspacing, i = i->next) ;
++	return w;
++}
++
+ Bool
+ gettextprop(Window w, Atom atom, char *text, unsigned int size) {
+ 	char **list = NULL;
+ 	int n;
+ 	XTextProperty name;
+@@ -1231,10 +1300,14 @@ mappingnotify(XEvent *e) {
+ 
+ void
+ maprequest(XEvent *e) {
+ 	static XWindowAttributes wa;
+ 	XMapRequestEvent *ev = &e->xmaprequest;
++	SystrayIcon *i;
++	if((i = wintosystrayicon(ev->window))) {
++		updatesystray();
++	}
+ 
+ 	if(!XGetWindowAttributes(dpy, ev->window, &wa))
+ 		return;
+ 	if(wa.override_redirect)
+ 		return;
+@@ -1344,13 +1417,18 @@ pop(Client *c) {
+ }
+ 
+ void
+ propertynotify(XEvent *e) {
+ 	Client *c;
++	SystrayIcon *i;
+ 	Window trans;
+ 	XPropertyEvent *ev = &e->xproperty;
+ 
++	if((i = wintosystrayicon(ev->window))) {
++		/* TODO include XEMBED functionality from systray_state */
++		updatesystray();
++	}
+ 	if((ev->window == root) && (ev->atom == XA_WM_NAME))
+ 		updatestatus();
+ 	else if((ev->window == root) && (ev->atom == focusatom))
+ 		focusatomchange();
+ 	else if(ev->state == PropertyDelete)
+@@ -1398,16 +1476,36 @@ recttomon(int x, int y, int w, int h) {
+ 		}
+ 	return r;
+ }
+ 
+ void
++removesystrayicon(SystrayIcon *i) {
++	SystrayIcon **ii;
++
++	if(!i || !showsystray)
++		return;
++	for(ii = &systray->icons; *ii && *ii != i; ii = &(*ii)->next);
++	*ii = i->next;
++	free(i);
++}
++
++
++void
+ resize(Client *c, int x, int y, int w, int h, Bool interact) {
+ 	if(applysizehints(c, &x, &y, &w, &h, interact))
+ 		resizeclient(c, x, y, w, h);
+ }
+ 
+ void
++resizebarwin(Monitor *m) {
++	unsigned int w = m->ww;
++	if(showsystray && m == selmon)
++		w -= getsystraywidth();
++	XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, w, bh);
++}
++
++void
+ resizeclient(Client *c, int x, int y, int w, int h) {
+ 	XWindowChanges wc;
+ 
+ 	c->oldx = c->x; c->x = wc.x = x;
+ 	c->oldy = c->y; c->y = wc.y = y;
+@@ -1666,10 +1764,13 @@ setup(void) {
+ 	wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
+ 	wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
+ 	wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False);
+ 	netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
+ 	netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
++	netatom[NetSystemTray] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_S0", False);
++	netatom[NetSystemTrayOP] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_OPCODE", False);
++	netatom[NetSystemTrayOrientation] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION", False);
+ 	netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
+ 	netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
+ 	netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
+ 	netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
+ 	netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False);
+@@ -1692,10 +1793,12 @@ setup(void) {
+ 	dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen));
+ 	dc.gc = XCreateGC(dpy, root, 0, NULL);
+ 	XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
+ 	if(!dc.font.set)
+ 		XSetFont(dpy, dc.gc, dc.font.xfont->fid);
++	/* init system tray */
++	updatesystray();
+ 	/* init bars */
+ 	updatebars();
+ 	updatestatus();
+ 	/* EWMH support per view */
+ 	XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32,
+@@ -1803,12 +1906,22 @@ tile(Monitor *m) {
+ 
+ void
+ togglebar(const Arg *arg) {
+ 	selmon->showbar = !selmon->showbar;
+ 	updatebarpos(selmon);
+-	XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
+ 	arrange(selmon);
++	if(showsystray) {
++		XWindowChanges wc;
++		if(!selmon->showbar)
++			wc.y = -bh;
++		else if(selmon->showbar) {
++			wc.y = 0;
++			if(!selmon->topbar)
++				wc.y = selmon->mh - bh;
++		}
++		XConfigureWindow(dpy, systray->win, CWY, &wc);
++	}
+ }
+ 
+ void
+ togglefloating(const Arg *arg) {
+ 	if(!selmon->sel)
+@@ -1885,32 +1998,41 @@ unmanage(Client *c, Bool destroyed) {
+ }
+ 
+ void
+ unmapnotify(XEvent *e) {
+ 	Client *c;
++	SystrayIcon *i;
+ 	XUnmapEvent *ev = &e->xunmap;
+ 
+ 	if((c = wintoclient(ev->window))) {
+ 		if(ev->send_event)
+ 			setclientstate(c, WithdrawnState);
+ 		else
+ 			unmanage(c, False);
++	} else if((i = wintosystrayicon(ev->window))) {
++		removesystrayicon(i);
++		updatesystray();
+ 	}
+ }
+ 
+ void
+ updatebars(void) {
++	unsigned int w;
+ 	Monitor *m;
++
+ 	XSetWindowAttributes wa = {
+ 		.override_redirect = True,
+ 		.background_pixmap = ParentRelative,
+ 		.event_mask = ButtonPressMask|ExposureMask
+ 	};
+ 	for(m = mons; m; m = m->next) {
+ 		if (m->barwin)
+ 			continue;
+-		m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
++		w = m->ww;
++		if(showsystray && m == selmon)
++			w -= getsystraywidth();
++		m->barwin = XCreateWindow(dpy, root, m->wx, m->by, w, bh, 0, DefaultDepth(dpy, screen),
+ 		                          CopyFromParent, DefaultVisual(dpy, screen),
+ 		                          CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
+ 		XDefineCursor(dpy, m->barwin, cursor[CurNormal]);
+ 		XMapRaised(dpy, m->barwin);
+ 	}
+@@ -2103,10 +2225,63 @@ updatestatus(void) {
+ 		strcpy(stext, "dwm-"VERSION);
+ 	drawbar(selmon);
+ }
+ 
+ void
++updatesystray(void) {
++	XSetWindowAttributes wa;
++	XEvent event;
++	SystrayIcon *i;
++	unsigned int x = selmon->mx + selmon->mw;
++	unsigned int w = 1;
++
++	if(!showsystray)
++		return;
++	if(!systray) {
++		/* init systray */
++		if(!(systray = (Systray *)calloc(1, sizeof(Systray))))
++			die("fatal: could not malloc() %u bytes\n", sizeof(Systray));
++		systray->win = XCreateSimpleWindow(dpy, root, x, selmon->by, w, bh, 0, 0, dc.norm[ColBG]);
++		wa.event_mask        = ButtonPressMask | ExposureMask;
++		wa.override_redirect = True;
++		wa.background_pixmap = ParentRelative;
++		wa.background_pixel  = dc.norm[ColBG];
++		XSelectInput(dpy, systray->win, SubstructureNotifyMask | SubstructureRedirectMask
++				| PointerMotionMask | PointerMotionHintMask | KeyPressMask | ButtonPressMask);
++		XChangeProperty(dpy, systray->win, netatom[NetSystemTrayOrientation], XA_CARDINAL, 32,
++				PropModeReplace, (unsigned char *)&systrayorientation, 1);
++		XChangeWindowAttributes(dpy, systray->win, CWEventMask | CWOverrideRedirect | CWBackPixel, &wa);
++		memset(&wa, 0, sizeof(XWindowAttributes));
++		XMapRaised(dpy, systray->win);
++		XSetSelectionOwner(dpy, netatom[NetSystemTray], systray->win, CurrentTime);
++		if(XGetSelectionOwner(dpy, netatom[NetSystemTray]) != systray->win)
++			fprintf(stderr, "dwm: unable to obtain system tray.\n");
++		else {
++			memset(&event, 0, sizeof(event));
++			event.xclient.type = ClientMessage;
++			event.xclient.window = root;
++			event.xclient.message_type = XInternAtom(dpy, "MANAGER", False);
++			event.xclient.format = 32;
++			event.xclient.data.l[0] = CurrentTime;
++			event.xclient.data.l[1] = netatom[NetSystemTray];
++			event.xclient.data.l[2] = systray->win;
++			event.xclient.data.l[3] = 0;
++			event.xclient.data.l[4] = 0;
++			XSendEvent(dpy, root, False, StructureNotifyMask, &event);
++			XSync(dpy, False);
++		}
++	}
++	for(i = systray->icons; i; i = i->next) {
++		XMapWindow(dpy, i->win);
++		XMoveResizeWindow(dpy, i->win, (i->geo.x = w), 0, i->geo.width, i->geo.height);
++		w += i->geo.width + systrayspacing;
++	}
++	x -= w;
++	XMoveResizeWindow(dpy, systray->win, x, selmon->by, w, bh);
++}
++
++void
+ updatewindowtype(Client *c) {
+ 	Atom state = getatomprop(c, netatom[NetWMState]);
+ 	Atom wtype = getatomprop(c, netatom[NetWMWindowType]);
+ 
+ 	if(state == netatom[NetWMFullscreen])
+@@ -2174,10 +2349,20 @@ wintomon(Window w) {
+ 	if((c = wintoclient(w)))
+ 		return c->mon;
+ 	return selmon;
+ }
+ 
++SystrayIcon *
++wintosystrayicon(Window w) {
++	SystrayIcon *i = NULL;
++
++	if(!w)
++		return i;
++	for(i = systray->icons; i && i->win != w; i = i->next) ;
++	return i;
++}
++
+ /* There's no way to check accesses to destroyed windows, thus those cases are
+  * ignored (especially on UnmapNotify's).  Other types of errors call Xlibs
+  * default error handler, which may call exit.  */
+ int
+ xerror(Display *dpy, XErrorEvent *ee) {

File dwm-config.diff

-# HG changeset patch
-# User Julien Jehannet <julien@smaf.org>
-# Date 1278366898 -7200
-# Node ID a51cd473aaefc8e7efcf89bbfbf51ac74407c853
-# Parent  53d98940cb04b146925234016fc83ebc4cfa4a0e
-[mq]: dwm
-
-diff --git a/config.h b/config.h
-new file mode 100644
---- /dev/null
-+++ b/config.h
-@@ -0,0 +1,111 @@
-+/* See LICENSE file for copyright and license details. */
-+
-+/* appearance */
-+static const char font[]            = "-*-terminus-*-*-*-*-12-*-*-*-*-*-*-u";
-+static const char normbordercolor[] = "#333333";
-+static const char normbgcolor[]     = "#111111";
-+static const char normfgcolor[]     = "#888888";
-+static const char selbordercolor[]  = "#ffff00";
-+static const char selbgcolor[]      = "#333333";
-+static const char selfgcolor[]      = "#ffff00";
-+static const unsigned int borderpx  = 2;        /* border pixel of windows */
-+static const unsigned int snap      = 8;        /* snap pixel */
-+static const Bool showbar           = True;     /* False means no bar */
-+static const Bool topbar            = True;     /* False means bottom bar */
-+
-+/* tagging */
-+static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
-+
-+static const Rule rules[] = {
-+	/* class      instance    title       tags mask     isfloating   monitor */
-+	{ "Gimp",     NULL,       NULL,       0,            True,        -1 },
-+	{ "Firefox",  NULL,       NULL,       1 << 8,       False,       -1 },
-+	{ "QEMU",     NULL,       NULL,       4,            True,        -1 },
-+	{ "Xeyes",    NULL,       NULL,       1 << 9,       False,       -1 },
-+};
-+
-+/* layout(s) */
-+static const float mfact      = 0.62; /* factor of master area size [0.05..0.95] */
-+static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
-+
-+static const Layout layouts[] = {
-+	/* symbol     arrange function */
-+	{ "τ",        tile },    /* first entry is default */
-+	{ "≈",        NULL },    /* no layout function means floating behavior */
-+	{ "⇔",        monocle },
-+};
-+
-+/* key definitions */
-+#define MODKEY Mod4Mask
-+#define TAGKEYS(KEY,TAG) \
-+	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
-+	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
-+	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
-+	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
-+
-+/* commands */
-+static const char *dmenucmd[] = { "/bin/zsh", "-fc", "$(print -lo ${commands:t} | dmenu -p Run)", NULL };
-+static const char *surfcmd[] = { "/bin/zsh", "-fc", "surf $(sselp)", NULL };
-+static const char *termcmd[]  = { "xterm", NULL };
-+static const char *conkycmd[]  = { "conky", NULL };
-+
-+static Key keys[] = {
-+	/* modifier                     key        function        argument */
-+	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
-+	{ MODKEY,                       XK_o,      spawn,          {.v = surfcmd } },
-+	{ MODKEY,                       XK_Return, spawn,          {.v = termcmd } },
-+	{ MODKEY,                       XK_Down,   focusstack,     {.i = +1 } },
-+	{ MODKEY,                       XK_Up,     focusstack,     {.i = -1 } },
-+	{ MODKEY,                       XK_Left,   focusstack,     {.i = -1} },
-+	{ MODKEY,                       XK_Right,  focusstack,     {.i = +1} },
-+	{ MODKEY|ShiftMask,             XK_Left,   setmfact,       {.f = -0.02} },
-+	{ MODKEY|ShiftMask,             XK_Right,  setmfact,       {.f = +0.02} },
-+	{ MODKEY|ControlMask,           XK_Left,   zoom,           {0} },
-+	{ MODKEY|ControlMask,           XK_Right,  zoom,           {0} },
-+	{ MODKEY|ControlMask,           XK_Return, zoom,           {0} },
-+	{ MODKEY,                       XK_Tab,    view,           {0} },
-+	{ MODKEY,                       XK_space,  zoom,           {0} },
-+	{ MODKEY|ShiftMask,             XK_space,  setlayout,      {0} },
-+	{ MODKEY|ControlMask,           XK_space,  setlayout,      {.v = &layouts[2]} },
-+	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[2]} },
-+	{ MODKEY|ControlMask,           XK_f,      setlayout,      {.v = &layouts[1]} },
-+	{ MODKEY,                       XK_d,      setlayout,      {.v = &layouts[0]} },
-+	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
-+	{ MODKEY|ShiftMask,             XK_f,      togglefloating, {0} },
-+	{ MODKEY|ControlMask,           XK_Prior,  focusmon,       {.i = -1 } },
-+	{ MODKEY|ControlMask,           XK_Next,   focusmon,       {.i = +1 } },
-+	{ MODKEY|ShiftMask,             XK_Prior,  tagmon,         {.i = -1 } },
-+	{ MODKEY|ShiftMask,             XK_Next,   tagmon,         {.i = +1 } },
-+	{ MODKEY,                       XK_agrave, view,           {.ui = ~0 } },
-+	{ MODKEY|ShiftMask,             XK_agrave, tag,            {.ui = ~0 } },
-+	TAGKEYS(                        XK_ampersand,              0)
-+	TAGKEYS(                        XK_eacute,                 1)
-+	TAGKEYS(                        XK_quotedbl,               2)
-+	TAGKEYS(                        XK_apostrophe,             3)
-+	TAGKEYS(                        XK_parenleft,              4)
-+	TAGKEYS(                        XK_minus,                  5)
-+	TAGKEYS(                        XK_egrave,                 6)
-+	TAGKEYS(                        XK_underscore,             7)
-+	TAGKEYS(                        XK_ccedilla,               8)
-+	{ MODKEY,                       XK_b,      togglebar,      {0} },
-+	{ MODKEY,                       XK_BackSpace, killclient,  {0} },
-+};
-+
-+/* button definitions */
-+/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
-+static Button buttons[] = {
-+	/* click                event mask      button          function        argument */
-+	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
-+	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
-+	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
-+	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
-+	{ ClkStatusText,        0,              Button3,        spawn,          {.v = conkycmd } },
-+	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
-+	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
-+	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
-+	{ ClkTagBar,            0,              Button1,        view,           {0} },
-+	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
-+	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
-+	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
-+};
-+

File dwm-config.h

 # HG changeset patch
-# Parent a40a8cb353552ed0e895800c74834a0404c42a10
+# Parent 10e232f9ace72da0ff7999b13f3a2b68cd4fa240
 # Date 1294783976 -3600
 # User Julien Jehannet <julien@smaf.org>
+* * *
+[mq]: dwm
 
 diff --git a/config.h b/config.h
---- a/config.h
+new file mode 100644
+--- /dev/null
 +++ b/config.h
-@@ -8,8 +8,8 @@ static const char normfgcolor[]     = "#
- static const char selbordercolor[]  = "#ffff00";
- static const char selbgcolor[]      = "#333333";
- static const char selfgcolor[]      = "#ffff00";
--static const unsigned int borderpx  = 2;        /* border pixel of windows */
--static const unsigned int snap      = 8;        /* snap pixel */
+@@ -0,0 +1,134 @@
++/* See LICENSE file for copyright and license details. */
++
++/* appearance */
++static const char font[]            = "-*-terminus-*-*-*-*-12-*-*-*-*-*-*-u";
++static const char normbordercolor[] = "#333333";
++static const char normbgcolor[]     = "#111111";
++static const char normfgcolor[]     = "#888888";
++static const char selbordercolor[]  = "#ffff00";
++static const char selbgcolor[]      = "#333333";
++static const char selfgcolor[]      = "#ffff00";
 +static const unsigned int borderpx  = 1;        /* border pixel of windows */
 +static const unsigned int snap      = 4;        /* snap pixel */
- static const Bool showbar           = True;     /* False means no bar */
- static const Bool topbar            = True;     /* False means bottom bar */
- 
-@@ -48,47 +48,59 @@ static const char *dmenucmd[] = { "/bin/
- static const char *surfcmd[] = { "/bin/zsh", "-fc", "surf $(sselp)", NULL };
- static const char *termcmd[]  = { "xterm", NULL };
- static const char *conkycmd[]  = { "conky", NULL };
++static const Bool showbar           = True;     /* False means no bar */
++static const Bool topbar            = True;     /* False means bottom bar */
++
++/* tagging */
++static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
++
++static const Rule rules[] = {
++	/* xprop(1):
++	 *	WM_CLASS(STRING) = instance, class
++	 *	WM_NAME(STRING) = title
++	 */
++	/* class      instance    title       tags mask     isfloating   monitor */
++	{ "Gimp",     NULL,       NULL,       0,            True,        -1 },
++	{ "Firefox",  NULL,       NULL,       1 << 8,       False,       -1 },
++	{ "QEMU",     NULL,       NULL,       4,            True,        -1 },
++	{ "Xeyes",    NULL,       NULL,       1 << 9,       False,       -1 },
++};
++
++/* layout(s) */
++static const float mfact      = 0.55; /* 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 */
++
++static const Layout layouts[] = {
++	/* symbol     arrange function */
++	{ "τ",        tile },    /* first entry is default */
++	{ "≈",        NULL },    /* no layout function means floating behavior */
++	{ "⇔",        monocle },
++};
++
++/* key definitions */
++#define MODKEY Mod4Mask
++#define TAGKEYS(KEY,TAG) \
++	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
++	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
++	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
++	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
++
++/* helper for spawning shell commands in the pre dwm-5.0 fashion */
++//#define SHCMD(cmd) { .v = (const char*[]){ "/bin/zsh", "-c", cmd, NULL } }
++
++/* commands */
++//static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
++static const char *dmenucmd[] = { "/bin/zsh", "-fc", "$(print -lo ${commands:t} | dmenu -p Run)", NULL };
++static const char *surfcmd[] = { "/bin/zsh", "-fc", "surf $(sselp)", NULL };
++static const char *termcmd[]  = { "xterm", NULL };
++static const char *conkycmd[]  = { "conky", NULL };
 +static const char *amixercmd[]  = { "amixer", "-q", "set", "Master", NULL };
 +static const char *audiomute[]  = { "amixer", "-q", "set", "Master", "toggle", NULL };
 +static const char *suspendcmd[]  = { "sudo", "pm-suspend", NULL };
 +static const char *scrsavcmd[]  = { "vlock", "-nas", NULL };
 +static const char *snapshotcmd[]  = { "import", "-quality", "60", "-comment", "%m:%f %wx%h", "~/screenshot.png", NULL };
- 
- static Key keys[] = {
--	/* modifier                     key        function        argument */
--	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
--	{ MODKEY,                       XK_o,      spawn,          {.v = surfcmd } },
--	{ MODKEY,                       XK_Return, spawn,          {.v = termcmd } },
--	{ MODKEY,                       XK_Down,   focusstack,     {.i = +1 } },
--	{ MODKEY,                       XK_Up,     focusstack,     {.i = -1 } },
--	{ MODKEY,                       XK_Left,   focusstack,     {.i = -1} },
--	{ MODKEY,                       XK_Right,  focusstack,     {.i = +1} },
--	{ MODKEY|ShiftMask,             XK_Left,   setmfact,       {.f = -0.02} },
--	{ MODKEY|ShiftMask,             XK_Right,  setmfact,       {.f = +0.02} },
--	{ MODKEY|ControlMask,           XK_Left,   zoom,           {0} },
--	{ MODKEY|ControlMask,           XK_Right,  zoom,           {0} },
--	{ MODKEY|ControlMask,           XK_Return, zoom,           {0} },
--	{ MODKEY,                       XK_Tab,    view,           {0} },
--	{ MODKEY,                       XK_space,  zoom,           {0} },
--	{ MODKEY|ShiftMask,             XK_space,  setlayout,      {0} },
--	{ MODKEY|ControlMask,           XK_space,  setlayout,      {.v = &layouts[2]} },
--	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[2]} },
--	{ MODKEY|ControlMask,           XK_f,      setlayout,      {.v = &layouts[1]} },
--	{ MODKEY,                       XK_d,      setlayout,      {.v = &layouts[0]} },
--	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
--	{ MODKEY|ShiftMask,             XK_f,      togglefloating, {0} },
--	{ MODKEY|ControlMask,           XK_Prior,  focusmon,       {.i = -1 } },
--	{ MODKEY|ControlMask,           XK_Next,   focusmon,       {.i = +1 } },
--	{ MODKEY|ShiftMask,             XK_Prior,  tagmon,         {.i = -1 } },
--	{ MODKEY|ShiftMask,             XK_Next,   tagmon,         {.i = +1 } },
--	{ MODKEY,                       XK_agrave, view,           {.ui = ~0 } },
--	{ MODKEY|ShiftMask,             XK_agrave, tag,            {.ui = ~0 } },
--	TAGKEYS(                        XK_ampersand,              0)
--	TAGKEYS(                        XK_eacute,                 1)
--	TAGKEYS(                        XK_quotedbl,               2)
--	TAGKEYS(                        XK_apostrophe,             3)
--	TAGKEYS(                        XK_parenleft,              4)
--	TAGKEYS(                        XK_minus,                  5)
--	TAGKEYS(                        XK_egrave,                 6)
--	TAGKEYS(                        XK_underscore,             7)
--	TAGKEYS(                        XK_ccedilla,               8)
--	{ MODKEY,                       XK_b,      togglebar,      {0} },
--	{ MODKEY,                       XK_BackSpace, killclient,  {0} },
++
++static Key keys[] = {
 +	/* modifier                     key                     function        argument */
 +	{ MODKEY,                       XK_p,                   spawn,          {.v = dmenucmd } },
 +	{ MODKEY,                       XK_o,                   spawn,          {.v = surfcmd } },
 +	{ MODKEY,                       XK_Right,               focusstack,     {.i = +1} },
 +	{ MODKEY|ShiftMask,             XK_Left,                setmfact,       {.f = -0.02} },
 +	{ MODKEY|ShiftMask,             XK_Right,               setmfact,       {.f = +0.02} },
++	{ MODKEY,                       XK_plus,                incnmaster,     {.i = +1 } },
++	{ MODKEY,                       XK_minus,               incnmaster,     {.i = -1 } },
 +	{ MODKEY|ControlMask,           XK_Left,                zoom,           {0} },
 +	{ MODKEY|ControlMask,           XK_Right,               zoom,           {0} },
 +	{ MODKEY|ControlMask,           XK_Return,              zoom,           {0} },
 +	{ 0,                            XF86XK_Standby,         spawn,          {.v = suspendcmd} },
 +	{ 0,                            XF86XK_AudioLowerVolume,spawn,          {.v = amixercmd} },
 +	{ 0,                            XF86XK_AudioRaiseVolume,spawn,          {.v = amixercmd} },
- };
- 
- /* button definitions */
-@@ -108,4 +120,3 @@ static Button buttons[] = {
- 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
- 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
- };
--
++};
++
++/* button definitions */
++/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
++static Button buttons[] = {
++	/* click                event mask      button          function        argument */
++	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
++	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
++	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
++	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
++	{ ClkStatusText,        0,              Button3,        spawn,          {.v = conkycmd } },
++	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
++	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
++	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
++	{ ClkTagBar,            0,              Button1,        view,           {0} },
++	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
++	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
++	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
++};
++
 diff --git a/dwm.c b/dwm.c
 --- a/dwm.c
 +++ b/dwm.c
-@@ -32,6 +32,7 @@
+@@ -30,10 +30,11 @@
+ #include <unistd.h>
+ #include <sys/types.h>
  #include <sys/wait.h>
  #include <X11/cursorfont.h>
  #include <X11/keysym.h>
  #include <X11/Xatom.h>
  #include <X11/Xlib.h>
  #include <X11/Xproto.h>
-@@ -854,6 +855,7 @@ void
- focusstack(const Arg *arg) {
- 	Client *c = NULL, *i;
+ #include <X11/Xutil.h>
+ #ifdef XINERAMA
+@@ -203,11 +204,11 @@ static void monocle(Monitor *m);
+ static void motionnotify(XEvent *e);
+ static void movemouse(const Arg *arg);
+ static Client *nexttiled(Client *c);
+ static void pop(Client *);
+ static void propertynotify(XEvent *e);
+-static void quit(const Arg *arg);
++//static void quit(const Arg *arg);
+ static Monitor *recttomon(int x, int y, int w, int h);
+ static void resize(Client *c, int x, int y, int w, int h, Bool interact);
+ static void resizeclient(Client *c, int x, int y, int w, int h);
+ static void resizemouse(const Arg *arg);
+ static void restack(Monitor *m);
+@@ -1331,14 +1332,14 @@ propertynotify(XEvent *e) {
+ 		if(ev->atom == netatom[NetWMWindowType])
+ 			updatewindowtype(c);
+ 	}
+ }
  
-+	//fprintf(stdout, "client: %s", selmon->sel->name);
- 	if(!selmon->sel)
- 		return;
- 	if(arg->i > 0) {
+-void
+-quit(const Arg *arg) {
+-	running = False;
+-}
++//void
++//quit(const Arg *arg) {
++//	running = False;
++//}
+ 
+ Monitor *
+ recttomon(int x, int y, int w, int h) {
+ 	Monitor *m, *r = selmon;
+ 	int a, area = 0;

File dwm-nextprevtag.inc

 # HG changeset patch
-# Parent 57d6a265c45bab837086acf8bf7c0e5c15c9951c
+# Parent acb761a37f956b8744fffffff3998111c0c1465e
 # Date 1294784199 -3600
 # User Julien Jehannet <julien@smaf.org>
 
 diff --git a/config.h b/config.h
 --- a/config.h
 +++ b/config.h
-@@ -33,6 +33,7 @@ static const Bool resizehints = True; /*
+@@ -36,10 +36,11 @@ static const float mfact      = 0.55; /*
+ static const int nmaster      = 1;    /* number of clients in master area */
+ static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
  
  #include "bstack.c"
  #include "bstackhoriz.c"
  static const Layout layouts[] = {
  	/* symbol     arrange function */
  	{ "τ",        tile },    /* first entry is default */
-@@ -87,6 +88,8 @@ static Key keys[] = {
- 	{ MODKEY|ShiftMask,             XK_f,                   togglefloating, {0} },
- 	{ MODKEY|ControlMask,           XK_Prior,               focusmon,       { .i = -1 } },
- 	{ MODKEY|ControlMask,           XK_Next,                focusmon,       { .i = +1 } },
-+	{ MODKEY,                       XK_Prior,               view_adjacent,  {.i = -1 } },
-+	{ MODKEY,                       XK_Next,                view_adjacent,  {.i = +1 } },
- 	{ MODKEY|ShiftMask,             XK_Prior,               tagmon,         { .i = -1 } },
- 	{ MODKEY|ShiftMask,             XK_Next,                tagmon,         { .i = +1 } },
- 	{ MODKEY,                       XK_agrave,              view,           { .ui = ~0 } },
-@@ -126,4 +129,6 @@ static Button buttons[] = {
+ 	{ "≈",        NULL },    /* no layout function means floating behavior */
+ 	{ "⇔",        monocle },
+@@ -135,7 +136,9 @@ static Button buttons[] = {
+ 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
+ 	{ ClkTagBar,            0,              Button1,        view,           {0} },
  	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
  	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
  	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
 +	{ ClkTagBar,            0,              Button4,        view_adjacent,  { .i = -1 } },
 +	{ ClkTagBar,            0,              Button5,        view_adjacent,  { .i = +1 } },
  };
+ 
 diff --git a/nextprevtag.c b/nextprevtag.c
 new file mode 100644
 --- /dev/null

File dwm-r1507-focusatom.diff

 # HG changeset patch
-# Parent 776a22ae740b1828b138dc7b1cb40d4f9b4f16a8
+# Parent 09f7bb221900182a38bacbcd8addf8a8b86c9bae
 # Date 1294703012 -3600
 # User Julien Jehannet <julien@smaf.org>
 
 diff --git a/dwm.c b/dwm.c
 --- a/dwm.c
 +++ b/dwm.c
-@@ -182,6 +182,7 @@ static void drawtext(const char *text, u
+@@ -184,10 +184,11 @@ static void drawbars(void);
+ static void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]);
+ static void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
  static void enternotify(XEvent *e);
  static void expose(XEvent *e);
  static void focus(Client *c);
  static void focusin(XEvent *e);
  static void focusmon(const Arg *arg);
  static void focusstack(const Arg *arg);
-@@ -269,6 +270,7 @@ static void (*handler[LASTEvent]) (XEven
+ static unsigned long getcolor(const char *colstr);
+ static Bool getrootptr(int *x, int *y);
+@@ -279,10 +280,11 @@ static void (*handler[LASTEvent]) (XEven
+ 	[MotionNotify] = motionnotify,
+ 	[PropertyNotify] = propertynotify,
  	[UnmapNotify] = unmapnotify
  };
  static Atom wmatom[WMLast], netatom[NetLast];
  static Bool running = True;
  static Cursor cursor[CurLast];
  static Display *dpy;
-@@ -846,6 +848,33 @@ focus(Client *c) {
+ static DC dc;
+ static Monitor *mons = NULL, *selmon = NULL;
+@@ -884,10 +886,37 @@ focus(Client *c) {
+ 	selmon->sel = c;
+ 	drawbars();
  }
  
  void
  focusin(XEvent *e) { /* there are some broken focus acquiring clients */
  	XFocusChangeEvent *ev = &e->xfocus;
  
-@@ -1270,6 +1299,8 @@ propertynotify(XEvent *e) {
+ 	if(selmon->sel && ev->window != selmon->sel->win)
+ 		setfocus(selmon->sel);
+@@ -1320,10 +1349,12 @@ propertynotify(XEvent *e) {
+ 	Window trans;
+ 	XPropertyEvent *ev = &e->xproperty;
  
  	if((ev->window == root) && (ev->atom == XA_WM_NAME))
  		updatestatus();
  	else if(ev->state == PropertyDelete)
  		return; /* ignore */
  	else if((c = wintoclient(ev->window))) {
-@@ -1539,6 +1570,7 @@ setup(void) {
- 	netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
+ 		switch(ev->atom) {
+ 		default: break;
+@@ -1641,10 +1672,11 @@ setup(void) {
  	netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
  	netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
+ 	netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
+ 	netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False);
+ 	netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
 +	focusatom = XInternAtom(dpy, "_DWM_FOCUS", False);
  	/* init cursors */
  	cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);
  	cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
+ 	cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
+ 	/* init appearance */

File dwm-r1522-viewontag.diff

 # HG changeset patch
-# Parent 5581ec51a422a2e46bd313854cc1acf59f919530
+# Parent 3262877d851f61458a0c8f5a821bf9c2bf115149
 # Date 1294700864 -3600
 # User Julien Jehannet <julien@smaf.org>
 
-
 diff --git a/config.def.h b/config.def.h
 --- a/config.def.h
 +++ b/config.def.h
-@@ -13,6 +13,7 @@ static const unsigned int borderpx  = 1;
+@@ -10,10 +10,11 @@ static const char selbgcolor[]      = "#
+ static const char selfgcolor[]      = "#eeeeee";
+ 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 */
  static const Bool topbar            = True;     /* False means bottom bar */
  
  /* tagging */
  static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+ 
+ static const Rule rules[] = {
 diff --git a/config.h b/config.h
 --- a/config.h
 +++ b/config.h
-@@ -13,6 +13,7 @@ static const unsigned int borderpx  = 1;
+@@ -11,10 +11,11 @@ static const char selfgcolor[]      = "#
+ static const char urgbordercolor[]  = "#ff0000";
+ static const unsigned int borderpx  = 1;        /* border pixel of windows */
  static const unsigned int snap      = 4;        /* snap pixel */
  static const Bool showbar           = True;     /* False means no bar */
  static const Bool topbar            = True;     /* False means bottom bar */
  
  /* tagging */
  static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+ 
+ static const Rule rules[] = {
 diff --git a/dwm.c b/dwm.c
 --- a/dwm.c
 +++ b/dwm.c
-@@ -1622,6 +1622,8 @@ tag(const Arg *arg) {
+@@ -1706,10 +1706,12 @@ void
+ tag(const Arg *arg) {
  	if(selmon->sel && arg->ui & TAGMASK) {
  		selmon->sel->tags = arg->ui & TAGMASK;
+ 		focus(NULL);
  		arrange(selmon);
 +		if(viewontag)
 +			view(arg);
  	}
  }
  
+ void
+ tagmon(const Arg *arg) {
-dmenu-config.h
-dmenu-xrdb.diff
-dmenu-ms_nl.diff
+#AAAAAA
+#dmenu-config.h
+#dmenu-xrdb.diff
+#dmenu-ms_nl.diff
+#dmenu-xresources.diff
 dwm-config.h
-dmenu-xresources.diff
 dwm-current_desktop.diff
-dwm-config.diff
 dwm-panel.diff
 dwm-5.9-bstack.diff
 dwm-5.7.2-urgentborder.diff
 dwm-nextprevtag.inc
 dwm-5.8.2-monocle_count.diff
 dwm-r1507-focusatom.diff
+dwm-6.0-systray.diff
 WIP-dwm-monitor.diff
 tabbed-config.h
 tabbed-autostart-xterm