| timplemented class:inst:title matching - dwm - [fork] customized build of dwm, … | |
| git clone git://src.adamsgaard.dk/dwm | |
| Log | |
| Files | |
| Refs | |
| README | |
| LICENSE | |
| --- | |
| commit d6a6eca71d760fb3b61e35b187b9b9fd51092c71 | |
| parent 39ffc18635686b1a65cd80d19828c4fe2aed982f | |
| Author: Anselm R. Garbe <[email protected]> | |
| Date: Wed, 23 Aug 2006 12:08:37 +0200 | |
| implemented class:inst:title matching | |
| Diffstat: | |
| M config.arg.h | 2 +- | |
| M config.default.h | 6 +++--- | |
| M tag.c | 8 ++++---- | |
| 3 files changed, 8 insertions(+), 8 deletions(-) | |
| --- | |
| diff --git a/config.arg.h b/config.arg.h | |
| t@@ -46,7 +46,7 @@ static Key key[] = { \ | |
| #define RULES \ | |
| static Rule rule[] = { \ | |
| - /* class:instance regex tags regex isfloat */ \ | |
| + /* class:instance:title regex tags regex isfloat */ \ | |
| { "Firefox.*", "net", False }, \ | |
| { "Gimp.*", NULL, True}, \ | |
| { "MPlayer.*", NULL, True}, \ | |
| diff --git a/config.default.h b/config.default.h | |
| t@@ -47,11 +47,11 @@ static Key key[] = { \ | |
| { MODKEY|ShiftMask, XK_q, quit, … | |
| }; | |
| -/* Query class:instance for regex matching info with following command: | |
| - * xprop | awk -F'"' '/^WM_CLASS/ { printf "%s:%s\n", $4, $2 }'*/ | |
| +/* Query class:instance:title for regex matching info with following command: | |
| + * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/{ pri… | |
| #define RULES \ | |
| static Rule rule[] = { \ | |
| - /* class:instance regex tags regex isfloat */ \ | |
| + /* class:instance:title regex tags regex isfloat */ \ | |
| { "Firefox.*", "2", False }, \ | |
| { "Gimp.*", NULL, True}, \ | |
| }; | |
| diff --git a/tag.c b/tag.c | |
| t@@ -78,18 +78,18 @@ initrregs() | |
| void | |
| settags(Client *c) | |
| { | |
| - char classinst[256]; | |
| + char prop[512]; | |
| unsigned int i, j; | |
| regmatch_t tmp; | |
| Bool matched = False; | |
| XClassHint ch; | |
| if(XGetClassHint(dpy, c->win, &ch)) { | |
| - snprintf(classinst, sizeof(classinst), "%s:%s", | |
| + snprintf(prop, sizeof(prop), "%s:%s:%s", | |
| ch.res_class ? ch.res_class : "", | |
| - ch.res_name ? ch.res_name : ""); | |
| + ch.res_name ? ch.res_name : "", c->name); | |
| for(i = 0; !matched && i < len; i++) | |
| - if(rreg[i].clregex && !regexec(rreg[i].clregex, classi… | |
| + if(rreg[i].clregex && !regexec(rreg[i].clregex, prop, … | |
| c->isfloat = rule[i].isfloat; | |
| for(j = 0; rreg[i].tregex && j < ntags; j++) { | |
| if(!regexec(rreg[i].tregex, tags[j], 1… |