X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=tag.c;h=67e2498326a821ff32aa3f89fa89aaf1f9a49131;hb=0464e42231199d7a6ea45e46cf7798f2b6cf972c;hp=5da3c31811a809ea4e5a50254c48a6fea46c2e49;hpb=2b5553b1ebf7c8e59b5ecf7128b932115ff2b313;p=dwm.git diff --git a/tag.c b/tag.c index 5da3c31..67e2498 100644 --- a/tag.c +++ b/tag.c @@ -21,15 +21,16 @@ typedef struct { /* CUSTOMIZE */ static Rule rule[] = { /* class:instance tags isfloat */ - { "Firefox.*", { [Twww] = "www" }, False }, + { "Firefox.*", { [Tnet] = "net" }, False }, { "Gimp.*", { 0 }, True}, }; char *tags[TLast] = { - [Tscratch] = "scratch", + [Tfnord] = "fnord", [Tdev] = "dev", - [Twww] = "www", + [Tnet] = "net", [Twork] = "work", + [Tmisc] = "misc", }; void (*arrange)(Arg *) = dotile; @@ -140,23 +141,11 @@ getnext(Client *c, unsigned int t) return c; } -void -heretag(Arg *arg) +Client * +getprev(Client *c) { - int i; - Client *c; - - if(arg->i == tsel) - return; - - if(!(c = getnext(clients, arg->i))) - return; - - for(i = 0; i < TLast; i++) - c->tags[i] = NULL; - c->tags[tsel] = tags[tsel]; - pop(c); - focus(c); + for(; c && !c->tags[tsel]; c = c->prev); + return c; } void @@ -176,18 +165,13 @@ void settags(Client *c) { char classinst[256]; - static unsigned int len = rule ? sizeof(rule) / sizeof(rule[0]) : 0; + static unsigned int len = sizeof(rule) / sizeof(rule[0]); unsigned int i, j; regex_t regex; regmatch_t tmp; Bool matched = False; XClassHint ch; - if(!len) { - c->tags[tsel] = tags[tsel]; - return; - } - if(XGetClassHint(dpy, c->win, &ch)) { snprintf(classinst, sizeof(classinst), "%s:%s", ch.res_class ? ch.res_class : "",