sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 5e9542f85913e40295fb23f61983cc6c5e4ae626
parent 7a6114e40c822c453545ced3288bccf96fccf787
Author: Kim Nielsen <kgn@one.com>
Date:   Sun, 18 Apr 2021 15:42:35 +0200

Added patch for dwm to kill unwanted windows

Diffstat:
Adwm.suckless.org/patches/notallowed/dwm-notallowed-6.2.diff | 67+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/notallowed/index.md | 14++++++++++++++
2 files changed, 81 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/notallowed/dwm-notallowed-6.2.diff b/dwm.suckless.org/patches/notallowed/dwm-notallowed-6.2.diff @@ -0,0 +1,67 @@ +diff -up dwm-6.2.orig/config.def.h dwm-6.2/config.def.h +--- dwm-6.2.orig/config.def.h 2021-04-17 17:58:27.803010601 +0200 ++++ dwm-6.2/config.def.h 2021-04-18 15:17:55.254072814 +0200 +@@ -26,9 +26,9 @@ static const Rule rules[] = { + * WM_CLASS(STRING) = instance, class + * WM_NAME(STRING) = title + */ +- /* class instance title tags mask isfloating monitor */ +- { "Gimp", NULL, NULL, 0, 1, -1 }, +- { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, ++ /* class instance title tags mask isfloating monitor notallowed */ ++ { "Gimp", NULL, NULL, 0, 1, -1, 0 }, ++ { "Firefox", NULL, NULL, 1 << 8, 0, -1, 0 }, + }; + + /* layout(s) */ +diff -up dwm-6.2.orig/dwm.c dwm-6.2/dwm.c +--- dwm-6.2.orig/dwm.c 2021-04-17 17:58:27.803010601 +0200 ++++ dwm-6.2/dwm.c 2021-04-18 15:26:14.659767016 +0200 +@@ -92,7 +92,7 @@ struct Client { + int basew, baseh, incw, inch, maxw, maxh, minw, minh; + int bw, oldbw; + unsigned int tags; +- int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; ++ int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen, notallowed; + Client *next; + Client *snext; + Monitor *mon; +@@ -139,6 +139,7 @@ typedef struct { + unsigned int tags; + int isfloating; + int monitor; ++ int notallowed; + } Rule; + + /* function declarations */ +@@ -297,6 +298,10 @@ applyrules(Client *c) + && (!r->class || strstr(class, r->class)) + && (!r->instance || strstr(instance, r->instance))) + { ++ if (r->notallowed) { ++ c->notallowed = r->notallowed; ++ break; ++ } + c->isfloating = r->isfloating; + c->tags |= r->tags; + for (m = mons; m && m->num != r->monitor; m = m->next); +@@ -1029,6 +1034,7 @@ manage(Window w, XWindowAttributes *wa) + c->w = c->oldw = wa->width; + c->h = c->oldh = wa->height; + c->oldbw = wa->border_width; ++ c->notallowed = 0; + + updatetitle(c); + if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { +@@ -1037,6 +1043,11 @@ manage(Window w, XWindowAttributes *wa) + } else { + c->mon = selmon; + applyrules(c); ++ if (c->notallowed) { ++ XKillClient(dpy, c->win); ++ free(c); ++ return; ++ } + } + + if (c->x + WIDTH(c) > c->mon->mx + c->mon->mw) diff --git a/dwm.suckless.org/patches/notallowed/index.md b/dwm.suckless.org/patches/notallowed/index.md @@ -0,0 +1,14 @@ +notallowed +===== + +Description +----------- +Extend the rules with a `notallowed` option to kill windows with a specific class, instance or title. + +Download +-------- +* [dwm-notallowed-6.2.diff](dwm-notallowed-6.2.diff) + +Author +------- +* Kim Gert Nielsen - <kn@insecurity.dk>