Adding tagallmon and tagswapmon patches

pull/32/head
bakkeby 5 years ago
parent 1d7247ebb5
commit ab6eb60657

@ -11,7 +11,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### 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:
@ -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/)
- 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)
- 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)
- allows you to toggle fullscreen on and off using a single shortcut key
- [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

@ -102,6 +102,14 @@ static Key keys[] = {
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, 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_2, 1)
TAGKEYS( XK_3, 2)

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

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

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

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

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

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

@ -28,6 +28,11 @@
*/
#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
* 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
@ -37,6 +42,12 @@
*/
#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.
* https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-togglefullscreen-6.2.diff
*/

Loading…
Cancel
Save