diff options
| author | bakkeby <[email protected]> | 2019-10-05 22:55:46 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2019-10-05 22:55:46 +0200 |
| commit | b6928ab1fb05c6e19c258ac5e16883b2fa84188a (patch) | |
| tree | 64793e2090d73b50a9df1f18d0d5110812835c84 | |
| parent | a8049d86bb9334d2848a80117679bd0605db6db2 (diff) | |
| download | dwm-flexipatch-b6928ab1fb05c6e19c258ac5e16883b2fa84188a.tar.gz dwm-flexipatch-b6928ab1fb05c6e19c258ac5e16883b2fa84188a.zip | |
Adding killunsel patch
| -rw-r--r-- | README.md | 5 | ||||
| -rw-r--r-- | config.def.h | 3 | ||||
| -rw-r--r-- | patch/include.c | 4 | ||||
| -rw-r--r-- | patch/include.h | 4 | ||||
| -rw-r--r-- | patch/killunsel.c | 22 | ||||
| -rw-r--r-- | patch/killunsel.h | 1 | ||||
| -rw-r--r-- | patches.h | 5 |
7 files changed, 44 insertions, 0 deletions
@@ -13,6 +13,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t ### Changelog: +2019-10-05 - Added killunsel patch + 2019-10-04 - Added maximize, movestack, monoclesymbol, noborder, tagall and tagintostack patches 2019-10-03 - Added onlyquitonempty and switchcol patches @@ -222,6 +224,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t - [unfloatvisible](https://dwm.suckless.org/patches/unfloatvisible/) - resets isfloating on any visible windows that have it set and optionally also applies a layout + - [killunsel](https://dwm.suckless.org/patches/killunsel/) + - kills all visible clients that are not selected (only the selected client will remain) + - [urgentborder](https://dwm.suckless.org/patches/urgentborder/) - this patch makes "urgent" windows have different colors diff --git a/config.def.h b/config.def.h index 5640b51..ec350fc 100644 --- a/config.def.h +++ b/config.def.h @@ -364,6 +364,9 @@ static Key keys[] = { { MODKEY, XK_z, showhideclient, {0} }, #endif // AWESOMEBAR_PATCH { MODKEY|ShiftMask, XK_c, killclient, {0} }, + #if KILLUNSEL_PATCH + { MODKEY|ShiftMask, XK_x, killunsel, {0} }, + #endif // KILLUNSEL_PATCH #if SELFRESTART_PATCH { MODKEY|ShiftMask, XK_r, self_restart, {0} }, #endif // SELFRESTART_PATCH diff --git a/patch/include.c b/patch/include.c index 714e4b4..204f2d8 100644 --- a/patch/include.c +++ b/patch/include.c @@ -52,6 +52,10 @@ #include "holdbar.c" #endif +#if KILLUNSEL_PATCH +#include "killunsel.c" +#endif + #if MAXIMIZE_PATCH #include "maximize.c" #endif diff --git a/patch/include.h b/patch/include.h index 1cae911..38f5485 100644 --- a/patch/include.h +++ b/patch/include.h @@ -52,6 +52,10 @@ #include "holdbar.h" #endif +#if KILLUNSEL_PATCH +#include "killunsel.h" +#endif + #if MAXIMIZE_PATCH #include "maximize.h" #endif diff --git a/patch/killunsel.c b/patch/killunsel.c new file mode 100644 index 0000000..9e06d53 --- /dev/null +++ b/patch/killunsel.c @@ -0,0 +1,22 @@ +void +killunsel(const Arg *arg) +{ + Client *i = NULL; + + if (!selmon->sel) + return; + + for (i = selmon->clients; i; i = i->next) { + if (ISVISIBLE(i) && i != selmon->sel) { + if (!sendevent(i, wmatom[WMDelete])) { + XGrabServer(dpy); + XSetErrorHandler(xerrordummy); + XSetCloseDownMode(dpy, DestroyAll); + XKillClient(dpy, i->win); + XSync(dpy, False); + XSetErrorHandler(xerror); + XUngrabServer(dpy); + } + } + } +}
\ No newline at end of file diff --git a/patch/killunsel.h b/patch/killunsel.h new file mode 100644 index 0000000..4f38a6e --- /dev/null +++ b/patch/killunsel.h @@ -0,0 +1 @@ +static void killunsel(const Arg *arg);
\ No newline at end of file @@ -175,6 +175,11 @@ */ #define HOLDBAR_PATCH 0 +/* This patch adds a keybinding to kills all visible clients that are not selected. + * https://dwm.suckless.org/patches/killunsel/ + */ +#define KILLUNSEL_PATCH 0 + /* Moves the layout symbol in the status bar to the left hand side. * http://dwm.suckless.org/patches/leftlayout/ */ |
