about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--config.arg.h2
-rw-r--r--config.default.h6
-rw-r--r--tag.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/config.arg.h b/config.arg.h
index d346856..70c245f 100644
--- a/config.arg.h
+++ b/config.arg.h
@@ -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
index 453da71..c0102b0 100644
--- a/config.default.h
+++ b/config.default.h
@@ -47,11 +47,11 @@ static Key key[] = { \
 	{ 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 --git a/tag.c b/tag.c
index bc36f08..512f355 100644
--- a/tag.c
+++ b/tag.c
@@ -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, 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)) {
='#n205'>205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259