Adding killunsel patch

pull/32/head
bakkeby 5 years ago
parent a8049d86bb
commit b6928ab1fb

@ -13,6 +13,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### Changelog: ### Changelog:
2019-10-05 - Added killunsel patch
2019-10-04 - Added maximize, movestack, monoclesymbol, noborder, tagall and tagintostack patches 2019-10-04 - Added maximize, movestack, monoclesymbol, noborder, tagall and tagintostack patches
2019-10-03 - Added onlyquitonempty and switchcol 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/) - [unfloatvisible](https://dwm.suckless.org/patches/unfloatvisible/)
- resets isfloating on any visible windows that have it set and optionally also applies a layout - 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/) - [urgentborder](https://dwm.suckless.org/patches/urgentborder/)
- this patch makes "urgent" windows have different colors - this patch makes "urgent" windows have different colors

@ -364,6 +364,9 @@ static Key keys[] = {
{ MODKEY, XK_z, showhideclient, {0} }, { MODKEY, XK_z, showhideclient, {0} },
#endif // AWESOMEBAR_PATCH #endif // AWESOMEBAR_PATCH
{ MODKEY|ShiftMask, XK_c, killclient, {0} }, { MODKEY|ShiftMask, XK_c, killclient, {0} },
#if KILLUNSEL_PATCH
{ MODKEY|ShiftMask, XK_x, killunsel, {0} },
#endif // KILLUNSEL_PATCH
#if SELFRESTART_PATCH #if SELFRESTART_PATCH
{ MODKEY|ShiftMask, XK_r, self_restart, {0} }, { MODKEY|ShiftMask, XK_r, self_restart, {0} },
#endif // SELFRESTART_PATCH #endif // SELFRESTART_PATCH

@ -52,6 +52,10 @@
#include "holdbar.c" #include "holdbar.c"
#endif #endif
#if KILLUNSEL_PATCH
#include "killunsel.c"
#endif
#if MAXIMIZE_PATCH #if MAXIMIZE_PATCH
#include "maximize.c" #include "maximize.c"
#endif #endif

@ -52,6 +52,10 @@
#include "holdbar.h" #include "holdbar.h"
#endif #endif
#if KILLUNSEL_PATCH
#include "killunsel.h"
#endif
#if MAXIMIZE_PATCH #if MAXIMIZE_PATCH
#include "maximize.h" #include "maximize.h"
#endif #endif

@ -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);
}
}
}
}

@ -0,0 +1 @@
static void killunsel(const Arg *arg);

@ -175,6 +175,11 @@
*/ */
#define HOLDBAR_PATCH 0 #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. /* Moves the layout symbol in the status bar to the left hand side.
* http://dwm.suckless.org/patches/leftlayout/ * http://dwm.suckless.org/patches/leftlayout/
*/ */

Loading…
Cancel
Save