mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Adding movestack patch
This commit is contained in:
parent
8c768b21e1
commit
e0a21f0869
@ -13,7 +13,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
|
|
||||||
### Changelog:
|
### Changelog:
|
||||||
|
|
||||||
2019-10-04 - Added maximize and monoclesymbol patches
|
2019-10-04 - Added maximize, movestack and monoclesymbol patches
|
||||||
|
|
||||||
2019-10-03 - Added onlyquitonempty and switchcol patches
|
2019-10-03 - Added onlyquitonempty and switchcol patches
|
||||||
|
|
||||||
@ -146,6 +146,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
- always display the the monocle-symbol as defined in config.h if the monocle-layout is activated
|
- always display the the monocle-symbol as defined in config.h if the monocle-layout is activated
|
||||||
- do not display the number of open clients in the current tag
|
- do not display the number of open clients in the current tag
|
||||||
|
|
||||||
|
- [movestack](https://dwm.suckless.org/patches/movestack/)
|
||||||
|
- allows you to move clients around in the stack and swap them with the master
|
||||||
|
|
||||||
- [onlyquitonempty](https://dwm.suckless.org/patches/onlyquitonempty/)
|
- [onlyquitonempty](https://dwm.suckless.org/patches/onlyquitonempty/)
|
||||||
- makes it so dwm will only exit via quit() if no windows are open (in order to prevent accidental loss of work)
|
- makes it so dwm will only exit via quit() if no windows are open (in order to prevent accidental loss of work)
|
||||||
|
|
||||||
|
@ -320,8 +320,8 @@ static Key keys[] = {
|
|||||||
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||||
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||||
#if ROTATESTACK_PATCH
|
#if ROTATESTACK_PATCH
|
||||||
{ MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } },
|
{ MODKEY|Mod4Mask, XK_j, rotatestack, {.i = +1 } },
|
||||||
{ MODKEY|ShiftMask, XK_k, rotatestack, {.i = -1 } },
|
{ MODKEY|Mod4Mask, XK_k, rotatestack, {.i = -1 } },
|
||||||
#endif // ROTATESTACK_PATCH
|
#endif // ROTATESTACK_PATCH
|
||||||
#if PUSH_PATCH || PUSH_NO_MASTER_PATCH
|
#if PUSH_PATCH || PUSH_NO_MASTER_PATCH
|
||||||
{ MODKEY|ControlMask, XK_j, pushdown, {0} },
|
{ MODKEY|ControlMask, XK_j, pushdown, {0} },
|
||||||
@ -336,6 +336,10 @@ static Key keys[] = {
|
|||||||
{ MODKEY|ShiftMask, XK_l, setcfact, {.f = -0.25} },
|
{ MODKEY|ShiftMask, XK_l, setcfact, {.f = -0.25} },
|
||||||
{ MODKEY|ShiftMask, XK_o, setcfact, {.f = 0.00} },
|
{ MODKEY|ShiftMask, XK_o, setcfact, {.f = 0.00} },
|
||||||
#endif // CFACTS_PATCH
|
#endif // CFACTS_PATCH
|
||||||
|
#if MOVESTACK_PATCH
|
||||||
|
{ MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
|
||||||
|
{ MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
|
||||||
|
#endif // MOVESTACK_PATCH
|
||||||
{ MODKEY, XK_Return, zoom, {0} },
|
{ MODKEY, XK_Return, zoom, {0} },
|
||||||
#if VANITYGAPS_PATCH
|
#if VANITYGAPS_PATCH
|
||||||
{ MODKEY|Mod4Mask, XK_u, incrgaps, {.i = +1 } },
|
{ MODKEY|Mod4Mask, XK_u, incrgaps, {.i = +1 } },
|
||||||
|
@ -56,6 +56,10 @@
|
|||||||
#include "maximize.c"
|
#include "maximize.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MOVESTACK_PATCH
|
||||||
|
#include "movestack.c"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if PERTAG_PATCH
|
#if PERTAG_PATCH
|
||||||
#include "pertag.c"
|
#include "pertag.c"
|
||||||
#endif
|
#endif
|
||||||
|
@ -56,6 +56,10 @@
|
|||||||
#include "maximize.h"
|
#include "maximize.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MOVESTACK_PATCH
|
||||||
|
#include "movestack.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if PERTAG_PATCH
|
#if PERTAG_PATCH
|
||||||
#include "pertag.h"
|
#include "pertag.h"
|
||||||
#endif
|
#endif
|
||||||
|
49
patch/movestack.c
Normal file
49
patch/movestack.c
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
void
|
||||||
|
movestack(const Arg *arg)
|
||||||
|
{
|
||||||
|
Client *c = NULL, *p = NULL, *pc = NULL, *i;
|
||||||
|
|
||||||
|
if (arg->i > 0) {
|
||||||
|
/* find the client after selmon->sel */
|
||||||
|
for (c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
|
||||||
|
if (!c)
|
||||||
|
for (c = selmon->clients; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* find the client before selmon->sel */
|
||||||
|
for (i = selmon->clients; i != selmon->sel; i = i->next)
|
||||||
|
if(ISVISIBLE(i) && !i->isfloating)
|
||||||
|
c = i;
|
||||||
|
if (!c)
|
||||||
|
for (; i; i = i->next)
|
||||||
|
if (ISVISIBLE(i) && !i->isfloating)
|
||||||
|
c = i;
|
||||||
|
}
|
||||||
|
/* find the client before selmon->sel and c */
|
||||||
|
for (i = selmon->clients; i && (!p || !pc); i = i->next) {
|
||||||
|
if (i->next == selmon->sel)
|
||||||
|
p = i;
|
||||||
|
if (i->next == c)
|
||||||
|
pc = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* swap c and selmon->sel selmon->clients in the selmon->clients list */
|
||||||
|
if (c && c != selmon->sel) {
|
||||||
|
Client *temp = selmon->sel->next==c?selmon->sel:selmon->sel->next;
|
||||||
|
selmon->sel->next = c->next==selmon->sel?c:c->next;
|
||||||
|
c->next = temp;
|
||||||
|
|
||||||
|
if (p && p != c)
|
||||||
|
p->next = c;
|
||||||
|
if (pc && pc != selmon->sel)
|
||||||
|
pc->next = selmon->sel;
|
||||||
|
|
||||||
|
if (selmon->sel == selmon->clients)
|
||||||
|
selmon->clients = c;
|
||||||
|
else if (c == selmon->clients)
|
||||||
|
selmon->clients = selmon->sel;
|
||||||
|
|
||||||
|
arrange(selmon);
|
||||||
|
}
|
||||||
|
}
|
1
patch/movestack.h
Normal file
1
patch/movestack.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
static void movestack(const Arg *arg);
|
@ -209,6 +209,11 @@
|
|||||||
*/
|
*/
|
||||||
#define MONOCLESYMBOL_PATCH 0
|
#define MONOCLESYMBOL_PATCH 0
|
||||||
|
|
||||||
|
/* This patch allows you to move clients around in the stack and swap them with the master.
|
||||||
|
* https://dwm.suckless.org/patches/movestack/
|
||||||
|
*/
|
||||||
|
#define MOVESTACK_PATCH 0
|
||||||
|
|
||||||
/* This patch makes it so dwm will only exit via quit() if no windows are open.
|
/* This patch makes it so dwm will only exit via quit() if no windows are open.
|
||||||
* This is to prevent you accidentally losing all your work.
|
* This is to prevent you accidentally losing all your work.
|
||||||
* https://dwm.suckless.org/patches/onlyquitonempty/
|
* https://dwm.suckless.org/patches/onlyquitonempty/
|
||||||
|
Loading…
Reference in New Issue
Block a user