On Sat, Apr 12, 2008 at 11:43:52AM +0200, Anselm R. Garbe wrote:
> Yea, I propose to call it isimmortal.

You're the boss..

I also added a test for arg in killclient, so that I can have an
extra keybinding to killclient("somestring") to kill immortals. That
takes care of the aforementioned cornercases.

Have a nice weekend

Martin
diff -up dwm-4.9/config.def.h dwm-4.9-nokill/config.def.h
--- dwm-4.9/config.def.h	2008-04-03 22:57:01.000000000 +0200
+++ dwm-4.9-nokill/config.def.h	2008-04-12 17:49:29.000000000 +0200
@@ -14,8 +14,9 @@
 const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
 
 Rule rules[] = {
-	/* class	instance	title		tags ref	isfloating */
-	{ "Gimp",	NULL,		NULL,		NULL,		True },
+	/* class	instance	title		tags ref	isfloating isimmortal*/
+	{ "Gimp",	NULL,		NULL,		NULL,		True , False},
+	{ "UXTerm",	NULL,		NULL,		NULL,		False, True},
 };
 
 /* geometries, s{x,y,w,h} and bh are already initualized here */
@@ -55,6 +56,7 @@ Key keys[] = {
 	{ MODKEY,			XK_Return,	zoom,		NULL },
 	{ MODKEY,			XK_Tab,		viewprevtag,	NULL },
 	{ MODKEY|ShiftMask,		XK_c,		killclient,	NULL },
+	{ MODKEY|ControlMask|ShiftMask,		XK_c,		killclient,	"kill_immortals"},
 	{ MODKEY,			XK_space,	setlayout,	NULL },
 	{ MODKEY|ShiftMask,		XK_space,	togglefloating,	NULL },
 	{ MODKEY|ControlMask,		XK_space,	setgeom,	NULL },
diff -up dwm-4.9/dwm.c dwm-4.9-nokill/dwm.c
--- dwm-4.9/dwm.c	2008-04-03 22:57:01.000000000 +0200
+++ dwm-4.9-nokill/dwm.c	2008-04-12 17:47:51.000000000 +0200
@@ -70,7 +70,7 @@ struct Client {
 	int minax, maxax, minay, maxay;
 	long flags;
 	unsigned int bw, oldbw;
-	Bool isbanned, isfixed, isfloating, isurgent;
+	Bool isbanned, isfixed, isfloating, isurgent, isimmortal;
 	Bool *tags;
 	Client *next;
 	Client *prev;
@@ -117,6 +117,7 @@ typedef struct {
 	const char *title;
 	const char *tag;
 	Bool isfloating;
+	Bool isimmortal;
 } Rule;
 
 /* function declarations */
@@ -266,6 +267,7 @@ applyrules(Client *c) {
 		|| (ch.res_name && r->instance && strstr(ch.res_name, r->instance)))
 		{
 			c->isfloating = r->isfloating;
+			c->isimmortal = r->isimmortal;
 			if(r->tag) {
 				c->tags[idxoftag(r->tag)] = True;
 				matched = True;
@@ -969,6 +971,8 @@ killclient(const char *arg) {
 
 	if(!sel)
 		return;
+	if(sel->isimmortal && !arg)
+		return;
 	if(isprotodel(sel)) {
 		ev.type = ClientMessage;
 		ev.xclient.window = sel->win;

Reply via email to