diff -up dwm-5.5/config.def.h dwm-5.5.mt/config.def.h --- dwm-5.5/config.def.h 2009-04-18 13:49:24.000000000 +0200 +++ dwm-5.5.mt/config.def.h 2009-06-18 20:49:40.000000000 +0200 @@ -67,6 +67,10 @@ static Key keys[] = { { MODKEY, XK_space, setlayout, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, { MODKEY, XK_0, view, {.ui = ~0 } }, + { MODKEY, XK_Left, prevview, {0} }, + { MODKEY, XK_Right, nextview, {0} }, + { MODKEY|ShiftMask, XK_Left, prevtag, {0} }, + { MODKEY|ShiftMask, XK_Right, nexttag, {0} }, { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, TAGKEYS( XK_1, 0) TAGKEYS( XK_2, 1) diff -up dwm-5.5/dwm.1 dwm-5.5.mt/dwm.1 --- dwm-5.5/dwm.1 2009-04-18 13:49:24.000000000 +0200 +++ dwm-5.5.mt/dwm.1 2009-06-18 21:00:46.000000000 +0200 @@ -96,6 +96,18 @@ Toggle focused window between tiled and .B Mod1\-Tab Toggles to the previously selected tags. .TP +.B Mod1\-Left +View windows with previous tag +.TP +.B Mod1\-Right +View windows with next tag +.TP +.B Mod1\-Shift\-Left +Apply previous tag to focused window +.TP +.B Mod1\-Shift\-Right +Apply next tag to focused window +.TP .B Mod1\-Shift\-[1..n] Apply .RB nth diff -up dwm-5.5/dwm.c dwm-5.5.mt/dwm.c --- dwm-5.5/dwm.c 2009-04-18 13:49:24.000000000 +0200 +++ dwm-5.5.mt/dwm.c 2009-06-18 20:55:46.000000000 +0200 @@ -167,7 +167,11 @@ 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 nextview(const Arg *arg); +static void prevview(const Arg *arg); +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); @@ -1047,6 +1051,17 @@ movemouse(const Arg *arg) { XUngrabPointer(dpy, CurrentTime); } +void +nexttag(const Arg *arg) { + if(sel) { + if (sel->tags < (1 << (LENGTH(tags)-1))) + sel->tags = (sel->tags << 1) & TAGMASK; + else + sel->tags = 1 & TAGMASK; + arrange(); + } +} + Client * nexttiled(Client *c) { for(; c && (c->isfloating || !ISVISIBLE(c)); c = c->next); @@ -1054,6 +1069,47 @@ nexttiled(Client *c) { } void +nextview(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(); + } +} + +void +prevtag(const Arg *arg) { + if(sel) { + if (sel->tags > 1) + sel->tags = (sel->tags >> 1) & TAGMASK; + else + sel->tags = (1 << (LENGTH(tags) - 1)) & TAGMASK; + arrange(); + } +} + +void +prevview(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;