diff --git a/config.def.h b/config.def.h index e174a6c..3434a18 100644 --- a/config.def.h +++ b/config.def.h @@ -26,7 +26,7 @@ static const char *colors[][3] = { }; /* tagging */ -static const char *tags[] = { "", "", "3", "4", "5", "6", "7", "8", "" }; +static const char *tags[] = { "", "", "3", "", "5", "6", "7", "8", "" }; static const Rule rules[] = { /* xprop(1): @@ -80,7 +80,9 @@ static Key keys[] = { { MODKEY, XK_h, setmfact, {.f = -0.05} }, { MODKEY, XK_l, setmfact, {.f = +0.05} }, { MODKEY|ShiftMask, XK_Return, zoom, {0} }, - { MODKEY, XK_Tab, view, {.i = +1} }, + { MODKEY, XK_Tab, view, {.ui = 0 } }, // next tab + { MODKEY|ShiftMask, XK_Tab, view, {.ui = -1 } }, // prev tab + { MODKEY|ControlMask, XK_Tab, view, {.ui = -2 } }, // last tab { MODKEY, XK_q, killclient, {0} }, { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, diff --git a/config.h b/config.h index e174a6c..3434a18 100644 --- a/config.h +++ b/config.h @@ -26,7 +26,7 @@ static const char *colors[][3] = { }; /* tagging */ -static const char *tags[] = { "", "", "3", "4", "5", "6", "7", "8", "" }; +static const char *tags[] = { "", "", "3", "", "5", "6", "7", "8", "" }; static const Rule rules[] = { /* xprop(1): @@ -80,7 +80,9 @@ static Key keys[] = { { MODKEY, XK_h, setmfact, {.f = -0.05} }, { MODKEY, XK_l, setmfact, {.f = +0.05} }, { MODKEY|ShiftMask, XK_Return, zoom, {0} }, - { MODKEY, XK_Tab, view, {.i = +1} }, + { MODKEY, XK_Tab, view, {.ui = 0 } }, // next tab + { MODKEY|ShiftMask, XK_Tab, view, {.ui = -1 } }, // prev tab + { MODKEY|ControlMask, XK_Tab, view, {.ui = -2 } }, // last tab { MODKEY, XK_q, killclient, {0} }, { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, diff --git a/dwm b/dwm index eddc1cf..cb184c4 100755 Binary files a/dwm and b/dwm differ diff --git a/dwm.c b/dwm.c index a95747a..159d1c7 100644 --- a/dwm.c +++ b/dwm.c @@ -2045,9 +2045,30 @@ view(const Arg *arg) { if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) return; - selmon->seltags ^= 1; /* toggle sel tagset */ - if (arg->ui & TAGMASK) + + if (arg->ui != -2) + selmon->tagset[selmon->seltags ^ 1] = selmon->tagset[selmon->seltags]; + + if (arg->ui == 0) { + if (selmon->tagset[selmon->seltags] << 1 > TAGMASK) + selmon->tagset[selmon->seltags] = 1; + else + selmon->tagset[selmon->seltags] <<= 1; + } + else if (arg->ui == -1) { + if (selmon->tagset[selmon->seltags] >> 1 < 1) + selmon->tagset[selmon->seltags] = (TAGMASK + 1) >> 1; + else + selmon->tagset[selmon->seltags] >>= 1; + } + else if (arg->ui == -2) { + selmon->tagset[selmon->seltags] += selmon->tagset[selmon->seltags ^ 1]; + selmon->tagset[selmon->seltags ^ 1] = selmon->tagset[selmon->seltags] - selmon->tagset[selmon->seltags ^ 1]; + selmon->tagset[selmon->seltags] -= selmon->tagset[selmon->seltags ^ 1]; + } + else if (arg->ui & TAGMASK) selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; + focus(NULL); arrange(selmon); } diff --git a/dwm.o b/dwm.o index 59e08ae..d8b7adc 100644 Binary files a/dwm.o and b/dwm.o differ