X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=tag.c;h=f4ddfd97864a37638cb5d9f6e74470a0312e52b5;hb=95e8d12b7189d4cd01b8ae8ecebfa5835a1809e6;hp=c42a76063d3d25cfd3dd66abf34051a772cb83e0;hpb=7b5638f61d5c8b5a76bc3f7a5962cb7490da3b6b;p=dwm.git diff --git a/tag.c b/tag.c index c42a760..f4ddfd9 100644 --- a/tag.c +++ b/tag.c @@ -3,7 +3,6 @@ * See LICENSE file for license details. */ #include "dwm.h" - #include #include #include @@ -18,24 +17,10 @@ typedef struct { Bool isfloat; } Rule; -/* CUSTOMIZE */ -static Rule rule[] = { - /* class:instance tags isfloat */ - { "Firefox.*", { [Tnet] = "net" }, False }, - { "Gimp.*", { 0 }, True}, -}; - -char *tags[TLast] = { - [Tfnord] = "fnord", - [Tdev] = "dev", - [Tnet] = "net", - [Twork] = "work", - [Tmisc] = "misc", -}; - -void (*arrange)(Arg *) = dotile; +TAGS +RULES -/* END CUSTOMIZE */ +void (*arrange)(Arg *) = DEFMODE; /* extern */ @@ -100,26 +85,26 @@ dotile(Arg *arg) if(n == 1) { c->x = sx; c->y = sy + bh; - c->w = sw - 2 * c->border; - c->h = sh - 2 * c->border - bh; + c->w = sw - 2; + c->h = sh - 2 - bh; } else if(i == 0) { c->x = sx; c->y = sy + bh; - c->w = mw - 2 * c->border; - c->h = sh - 2 * c->border - bh; + c->w = mw - 2; + c->h = sh - 2 - bh; } else if(h > bh) { c->x = sx + mw; c->y = sy + (i - 1) * h + bh; - c->w = w - 2 * c->border; - c->h = h - 2 * c->border; + c->w = w - 2; + c->h = h - 2; } else { /* fallback if h < bh */ c->x = sx + mw; c->y = sy + bh; - c->w = w - 2 * c->border; - c->h = sh - 2 * c->border - bh; + c->w = w - 2; + c->h = sh - 2 - bh; } resize(c, False, TopLeft); i++; @@ -216,3 +201,17 @@ view(Arg *arg) arrange(NULL); drawall(); } + +void +viewnext(Arg *arg) +{ + arg->i = (tsel < TLast-1) ? tsel+1 : 0; + view(arg); +} + +void +viewprev(Arg *arg) +{ + arg->i = (tsel > 0) ? tsel-1 : TLast-1; + view(arg); +}