diff -up dwm/config.def.h new/config.def.h --- dwm/config.def.h 2008-10-23 17:35:39.000000000 +0200 +++ new/config.def.h 2008-10-23 17:49:42.000000000 +0200 @@ -69,6 +69,8 @@ static Key keys[] = { { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, { MODKEY, XK_0, view, {.ui = ~0 } }, { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, + { MODKEY|ShiftMask, XK_Left, prevtag, {0} }, + { MODKEY|ShiftMask, XK_Right, nexttag, {0} }, TAGKEYS( XK_1, 0) TAGKEYS( XK_2, 1) TAGKEYS( XK_3, 2) diff -up dwm/dwm.c new/dwm.c --- dwm/dwm.c 2008-10-23 17:35:39.000000000 +0200 +++ new/dwm.c 2008-10-23 17:47:42.000000000 +0200 @@ -168,7 +168,9 @@ static void mappingnotify(XEvent *e); static void maprequest(XEvent *e); static void monocle(void); static void movemouse(const Arg *arg); +static void nexttag(const Arg *arg); static Client *nexttiled(Client *c); +static void prevtag(const Arg *arg); static void propertynotify(XEvent *e); static void quit(const Arg *arg); static void resize(Client *c, int x, int y, int w, int h, Bool sizehints); @@ -985,6 +987,21 @@ movemouse(const Arg *arg) { XUngrabPointer(dpy, CurrentTime); } +void +nexttag(const Arg *arg) { + unsigned int mask; + + if (tagset[seltags] >= (1 << (LENGTH(tags)-1))) + mask = 1 & TAGMASK; + else + mask = (tagset[seltags] << 1) & TAGMASK; + + if(mask) { + tagset[seltags] = mask; + arrange(); + } +} + Client * nexttiled(Client *c) { for(; c && (c->isfloating || !ISVISIBLE(c)); c = c->next); @@ -992,6 +1009,21 @@ nexttiled(Client *c) { } void +prevtag(const Arg *arg) { + unsigned int mask; + + if (tagset[seltags] <= 1) + mask = (1 << (LENGTH(tags) - 1)) & TAGMASK; + else + mask = (tagset[seltags] >> 1) & TAGMASK; + + if(mask) { + tagset[seltags] = mask; + arrange(); + } +} + +void propertynotify(XEvent *e) { Client *c; Window trans;