diff -r e121660425a0 config.def.h --- a/config.def.h Sat Jun 14 10:38:18 2008 +0100 +++ b/config.def.h Sat Jun 14 10:41:32 2008 +0100 @@ -51,8 +51,31 @@ static const char *dmenucmd[] = { "dmenu static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; static const char *termcmd[] = { "uxterm", NULL }; + +static void +prevtag(const Arg *arg) { + uint i; + Arg a; + + for(i = 0; i < LENGTH(tags) && !(tagset[seltags] & (1 << i)); i++); + a.ui = 1 << (i == 0 ? LENGTH(tags) - 1 : i - 1); + view(&a); +} + +static void +nexttag(const Arg *arg) { + uint i; + Arg a; + + for(i = 0; i < LENGTH(tags) && !(tagset[seltags] & (1 << i)); i++); + a.ui = 1 << (i == LENGTH(tags) - 1 ? 0 : i + 1); + view(&a); +} + static Key keys[] = { /* modifier key function argument */ + { MODKEY, XK_Left, prevtag, {0} }, + { MODKEY, XK_Right, nexttag, {0} }, { MODKEY, XK_p, spawn, {.v = dmenucmd } }, { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, { MODKEY, XK_b, togglebar, {0} },