# HG changeset patch # User Anselm R. Garbe # Date 1156327717 -7200 # Node ID 2a65e8b3d21ae6822546bde2d283d16ff5a033b8 # Parent aca8281c7415607e283b36bc5aa2367f30549a90 implemented class:inst:title matching diff -r aca8281c7415 -r 2a65e8b3d21a config.arg.h --- a/config.arg.h Wed Aug 23 12:03:25 2006 +0200 +++ b/config.arg.h Wed Aug 23 12:08:37 2006 +0200 @@ -46,7 +46,7 @@ #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 -r aca8281c7415 -r 2a65e8b3d21a config.default.h --- a/config.default.h Wed Aug 23 12:03:25 2006 +0200 +++ b/config.default.h Wed Aug 23 12:08:37 2006 +0200 @@ -47,11 +47,11 @@ { MODKEY|ShiftMask, XK_q, quit, { 0 } }, \ }; -/* 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/{ printf("%s\n",$2) }' */ #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 -r aca8281c7415 -r 2a65e8b3d21a tag.c --- a/tag.c Wed Aug 23 12:03:25 2006 +0200 +++ b/tag.c Wed Aug 23 12:08:37 2006 +0200 @@ -78,18 +78,18 @@ 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, classinst, 1, &tmp, 0)) { + if(rreg[i].clregex && !regexec(rreg[i].clregex, prop, 1, &tmp, 0)) { c->isfloat = rule[i].isfloat; for(j = 0; rreg[i].tregex && j < ntags; j++) { if(!regexec(rreg[i].tregex, tags[j], 1, &tmp, 0)) {