Adding tagallmon and tagswapmon patches

This commit is contained in:
bakkeby 2019-09-05 23:59:13 +02:00
parent 1d7247ebb5
commit ab6eb60657
9 changed files with 135 additions and 2 deletions

View File

@ -11,7 +11,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### Changelog: ### Changelog:
2019-09-05 - Alpha, systray, togglefullscreen, pertag and zoomswap patches added 2019-09-05 - Alpha, systray, togglefullscreen, tagallmon, tagmonfixfs, tagswapmon, pertag and zoomswap patches added
### Patches included: ### Patches included:
@ -24,12 +24,17 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
- [systray](https://dwm.suckless.org/patches/systray/) - [systray](https://dwm.suckless.org/patches/systray/)
- adds system tray in the status bar - adds system tray in the status bar
- [tagallmon](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-tagallmon-6.2.diff)
- move all visible windows to an adjacent monitor
- [tagmonfixfs](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-tagmonfixfs-6.2.diff) - [tagmonfixfs](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-tagmonfixfs-6.2.diff)
- allows moving a fullscreen window to another monitor while remaining in fullscreen - allows moving a fullscreen window to another monitor while remaining in fullscreen
- [tagswapmon](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-tagswapmon-6.2.diff)
- swap all visible windows on one monitor with those of an adjacent monitor
- [togglefullscreen](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-togglefullscreen-6.2.diff) - [togglefullscreen](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-togglefullscreen-6.2.diff)
- allows you to toggle fullscreen on and off using a single shortcut key - allows you to toggle fullscreen on and off using a single shortcut key
- [zoomswap](https://dwm.suckless.org/patches/zoomswap/) - [zoomswap](https://dwm.suckless.org/patches/zoomswap/)
- allows a master and a stack window to swap places rather than every window on the screen changing position - allows a master and a stack window to swap places rather than every window on the screen changing position

View File

@ -102,6 +102,14 @@ static Key keys[] = {
{ MODKEY, XK_period, focusmon, {.i = +1 } }, { MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
#if TAGALLMON_PATCH
{ MODKEY|Mod4Mask|ShiftMask, XK_comma, tagallmon, {.i = +1 } },
{ MODKEY|Mod4Mask|ShiftMask, XK_period, tagallmon, {.i = -1 } },
#endif // TAGALLMON_PATCH
#if TAGSWAPMON_PATCH
{ MODKEY|Mod4Mask|ControlMask, XK_comma, tagswapmon, {.i = +1 } },
{ MODKEY|Mod4Mask|ControlMask, XK_period, tagswapmon, {.i = -1 } },
#endif // TAGSWAPMON_PATCH
TAGKEYS( XK_1, 0) TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1) TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2) TAGKEYS( XK_3, 2)

View File

@ -10,6 +10,14 @@
#include "systray.c" #include "systray.c"
#endif #endif
#if TAGALLMON_PATCH
#include "tagallmon.c"
#endif
#if TAGSWAPMON_PATCH
#include "tagswapmon.c"
#endif
#if TOGGLEFULLSCREEN_PATCH #if TOGGLEFULLSCREEN_PATCH
#include "togglefullscreen.c" #include "togglefullscreen.c"
#endif #endif

View File

@ -6,6 +6,14 @@
#include "systray.h" #include "systray.h"
#endif #endif
#if TAGALLMON_PATCH
#include "tagallmon.h"
#endif
#if TAGSWAPMON_PATCH
#include "tagswapmon.h"
#endif
#if TOGGLEFULLSCREEN_PATCH #if TOGGLEFULLSCREEN_PATCH
#include "togglefullscreen.h" #include "togglefullscreen.h"
#endif #endif

31
patch/tagallmon.c Normal file
View File

@ -0,0 +1,31 @@
void
tagallmon(const Arg *arg)
{
Monitor *m;
Client *c;
Client *next;
if (!mons->next)
return;
m = dirtomon(arg->i);
for (c = selmon->clients; c; c = next) {
next = c->next;
if (!ISVISIBLE(c))
continue;
unfocus(c, 1);
detach(c);
detachstack(c);
c->mon = m;
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
attach(c);
attachstack(c);
if (c->isfullscreen) {
setfullscreen(c, 0);
setfullscreen(c, 1);
}
}
focus(NULL);
arrange(NULL);
}

1
patch/tagallmon.h Normal file
View File

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

60
patch/tagswapmon.c Normal file
View File

@ -0,0 +1,60 @@
void
tagswapmon(const Arg *arg)
{
Monitor *m;
Client *c, *sc = NULL, *mc = NULL, *next;
if (!mons->next)
return;
m = dirtomon(arg->i);
for (c = selmon->clients; c; c = next) {
next = c->next;
if (!ISVISIBLE(c))
continue;
unfocus(c, 1);
detach(c);
detachstack(c);
c->next = sc;
sc = c;
}
for (c = m->clients; c; c = next) {
next = c->next;
if (!ISVISIBLE(c))
continue;
unfocus(c, 1);
detach(c);
detachstack(c);
c->next = mc;
mc = c;
}
for (c = sc; c; c = next) {
next = c->next;
c->mon = m;
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
attach(c);
attachstack(c);
if (c->isfullscreen) {
setfullscreen(c, 0);
setfullscreen(c, 1);
}
}
for (c = mc; c; c = next) {
next = c->next;
c->mon = selmon;
c->tags = selmon->tagset[selmon->seltags]; /* assign tags of target monitor */
attach(c);
attachstack(c);
if (c->isfullscreen) {
setfullscreen(c, 0);
setfullscreen(c, 1);
}
}
focus(NULL);
arrange(NULL);
}

1
patch/tagswapmon.h Normal file
View File

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

View File

@ -28,6 +28,11 @@
*/ */
#define PERTAGBAR_PATCH 0 #define PERTAGBAR_PATCH 0
/* This patch allows you to move all visible windows on a monitor to an adjacent monitor.
* https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-tagallmon-6.2.diff
*/
#define TAGALLMON_PATCH 0
/* If you try to send a fullscreen window to an adjacent monitor using tagmon then /* If you try to send a fullscreen window to an adjacent monitor using tagmon then
* the window is moved behind the scenes, but it remains in fullscreen on the original * the window is moved behind the scenes, but it remains in fullscreen on the original
* monitor until you exit fullscreen view (at which point it will appear on the adjacent * monitor until you exit fullscreen view (at which point it will appear on the adjacent
@ -37,6 +42,12 @@
*/ */
#define TAGMONFIXFS_PATCH 0 #define TAGMONFIXFS_PATCH 0
/* This patch allows you to swap all visible windows on one monitor with those of an
* adjacent monitor.
* https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-tagswapmon-6.2.diff
*/
#define TAGSWAPMON_PATCH 0
/* This patch allows you to toggle fullscreen on and off using a single shortcut key. /* This patch allows you to toggle fullscreen on and off using a single shortcut key.
* https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-togglefullscreen-6.2.diff * https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-togglefullscreen-6.2.diff
*/ */