Adding transferall patch

pull/32/head
bakkeby 4 years ago
parent 4ddfdab30e
commit 6de03c1735

@ -15,7 +15,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### Changelog:
2020-02-02 - Added fsignal patch and moved dwmc signal settings to config.def.h
2020-02-02 - Added fsignal and transferall patches
2020-01-29 - Added swapfocus and shiftview patches
@ -345,6 +345,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
- [transfer](https://dwm.suckless.org/patches/transfer/)
- lets you transfer the currently focused client between the master and stack area while increasing or decreasing the master area (nmaster) accordingly
- [transferall](https://dwm.suckless.org/patches/transfer/)
- lets you transfer all clients between the master and stack area while increasing or decreasing the master area (nmaster) accordingly
- [unfloatvisible](https://dwm.suckless.org/patches/unfloatvisible/)
- resets isfloating on any visible windows that have it set and optionally also applies a layout

@ -604,6 +604,9 @@ static Key keys[] = {
#if TRANSFER_PATCH
{ MODKEY, XK_x, transfer, {0} },
#endif // TRANSFER_PATCH
#if TRANSFER_ALL_PATCH
{ MODKEY|ControlMask, XK_x, transferall, {0} },
#endif // TRANSFER_ALL_PATCH
{ MODKEY, XK_Return, zoom, {0} },
#if VANITYGAPS_PATCH
{ MODKEY|Mod4Mask, XK_u, incrgaps, {.i = +1 } },

@ -131,6 +131,9 @@
#if TRANSFER_PATCH
#include "transfer.c"
#endif
#if TRANSFER_ALL_PATCH
#include "transferall.c"
#endif
#if UNFLOATVISIBLE_PATCH
#include "unfloatvisible.c"
#endif

@ -131,6 +131,9 @@
#if TRANSFER_PATCH
#include "transfer.h"
#endif
#if TRANSFER_ALL_PATCH
#include "transferall.h"
#endif
#if UNFLOATVISIBLE_PATCH
#include "unfloatvisible.h"
#endif

@ -0,0 +1,25 @@
void
transferall(const Arg *arg)
{
Client *c, *n = selmon->clients, *attachfrom = NULL;
int i = 0, nstackclients = 0;
while (n) {
c = n;
n = c->next;
if (!ISVISIBLE(c) || c->isfloating) continue;
if (i >= selmon->nmaster) {
detach(c);
if (!attachfrom) {
attach(c);
} else {
c->next = attachfrom->next;
attachfrom->next = c;
}
attachfrom = c;
nstackclients++;
}
i++;
}
selmon->nmaster = nstackclients;
arrange(selmon);
}

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

@ -538,6 +538,12 @@
*/
#define TRANSFER_PATCH 0
/* Lets you transfer all clients between the master and stack area
* while increasing or decreasing the master area (nmaster) accordingly.
* https://dwm.suckless.org/patches/transfer/
*/
#define TRANSFER_ALL_PATCH 0
/* This patch resets isfloating on any visible windows that have it set.
* Optionally also applies a layout.
* https://dwm.suckless.org/patches/unfloatvisible/

Loading…
Cancel
Save