diff options
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -58,7 +58,7 @@ /* enums */ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ -enum { SchemeNorm, SchemeSel }; /* color schemes */ +enum { SchemeNorm, SchemeSel, SchemeWarn, SchemeUrgent }; /* color schemes */ enum { NetSupported, NetWMName, NetWMState, NetWMCheck, NetWMFullscreen, NetActiveWindow, NetWMWindowType, NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ @@ -232,6 +232,7 @@ 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); +static void view_adjacent(const Arg *arg); /* variables */ static const char broken[] = "broken"; @@ -2139,6 +2140,28 @@ zoom(const Arg *arg) pop(c); } +void +view_adjacent(const Arg *arg) +{ + int i, curtags; + int seltag = 0; + Arg a; + + curtags = selmon->tagset[selmon->seltags]; + for(i = 0; i < LENGTH(tags); i++) + if(curtags & (1 << i)){ + seltag = i; + break; + } + + seltag = (seltag + arg->i) % (int)LENGTH(tags); + if(seltag < 0) + seltag += LENGTH(tags); + + a.i = (1 << seltag); + view(&a); +} + int main(int argc, char *argv[]) { |