summaryrefslogtreecommitdiff
path: root/x11-wm/dwm/files/07_bulkkill.diff
diff options
context:
space:
mode:
Diffstat (limited to 'x11-wm/dwm/files/07_bulkkill.diff')
-rw-r--r--x11-wm/dwm/files/07_bulkkill.diff70
1 files changed, 70 insertions, 0 deletions
diff --git a/x11-wm/dwm/files/07_bulkkill.diff b/x11-wm/dwm/files/07_bulkkill.diff
new file mode 100644
index 0000000..e8f25be
--- /dev/null
+++ b/x11-wm/dwm/files/07_bulkkill.diff
@@ -0,0 +1,70 @@
+diff --git c/config.def.h w/config.def.h
+index 1a9ab69..1f69eef 100644
+--- c/config.def.h
++++ w/config.def.h
+@@ -91,6 +91,8 @@ static const Key keys[] = {
+ { MODKEY|ShiftMask, XK_Return, zoom, {0} },
+ { MODKEY, XK_Tab, view, {0} },
+ { MODKEY|ShiftMask, XK_c, killclient, {0} },
++ { MODKEY|ControlMask, XK_c, killclient, {.ui = 1} }, // kill unselect
++ { MODKEY|ShiftMask|ControlMask, XK_c, killclient, {.ui = 2} }, // killall
+ { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, /* tatami */
+ { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, /* floating */
+ { MODKEY|ShiftMask, XK_t, setlayout, {.v = &layouts[2]} }, /* tile */
+diff --git c/dwm.c w/dwm.c
+index 7e78693..d789241 100644
+--- c/dwm.c
++++ w/dwm.c
+@@ -189,6 +189,7 @@ static void grabbuttons(Client *c, int focused);
+ static void grabkeys(void);
+ static void incnmaster(const Arg *arg);
+ static void keypress(XEvent *e);
++static void killthis(Client *c);
+ static void killclient(const Arg *arg);
+ static void manage(Window w, XWindowAttributes *wa);
+ static void mappingnotify(XEvent *e);
+@@ -1128,21 +1129,38 @@ keypress(XEvent *e)
+ }
+
+ void
+-killclient(const Arg *arg)
+-{
+- if (!selmon->sel)
+- return;
+- if (!sendevent(selmon->sel, wmatom[WMDelete])) {
++killthis(Client *c) {
++ if (!sendevent(c, wmatom[WMDelete])) {
+ XGrabServer(dpy);
+ XSetErrorHandler(xerrordummy);
+ XSetCloseDownMode(dpy, DestroyAll);
+- XKillClient(dpy, selmon->sel->win);
++ XKillClient(dpy, c->win);
+ XSync(dpy, False);
+ XSetErrorHandler(xerror);
+ XUngrabServer(dpy);
+ }
+ }
+
++void
++killclient(const Arg *arg)
++{
++ Client *c;
++
++ if (!selmon->sel)
++ return;
++
++ if (!arg->ui || arg->ui == 0) {
++ killthis(selmon->sel);
++ return;
++ }
++
++ for (c = selmon->clients; c; c = c->next) {
++ if (!ISVISIBLE(c) || (arg->ui == 1 && c == selmon->sel))
++ continue;
++ killthis(c);
++ }
++}
++
+ void
+ manage(Window w, XWindowAttributes *wa)
+ {