Adding tagall patch

pull/32/head
bakkeby 5 years ago
parent 69c6037b26
commit a25d00eb00

@ -13,7 +13,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### Changelog:
2019-10-04 - Added maximize, movestack, monoclesymbol, noborder patches
2019-10-04 - Added maximize, movestack, monoclesymbol, noborder and tagall patches
2019-10-03 - Added onlyquitonempty and switchcol patches
@ -197,6 +197,9 @@ 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
- [tagall](https://dwm.suckless.org/patches/tagall/)
- adds keyboard shortcuts to move all (or only floating) windows from one tag to another
- [tagallmon](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-tagallmon-6.2.diff)
- move all visible windows to an adjacent monitor

@ -426,6 +426,26 @@ static Key keys[] = {
{ MODKEY|ControlMask, XK_Left, tagandviewtoleft, {0} },
{ MODKEY|ControlMask, XK_Right, tagandviewtoright, {0} },
#endif // FOCUSADJACENTTAG_PATCH
#if TAGALL_PATCH
{ MODKEY|ShiftMask, XK_F1, tagall, {.v = "F1"} },
{ MODKEY|ShiftMask, XK_F2, tagall, {.v = "F2"} },
{ MODKEY|ShiftMask, XK_F3, tagall, {.v = "F3"} },
{ MODKEY|ShiftMask, XK_F4, tagall, {.v = "F4"} },
{ MODKEY|ShiftMask, XK_F5, tagall, {.v = "F5"} },
{ MODKEY|ShiftMask, XK_F6, tagall, {.v = "F6"} },
{ MODKEY|ShiftMask, XK_F7, tagall, {.v = "F7"} },
{ MODKEY|ShiftMask, XK_F8, tagall, {.v = "F8"} },
{ MODKEY|ShiftMask, XK_F9, tagall, {.v = "F9"} },
{ MODKEY|ControlMask, XK_F1, tagall, {.v = "1"} },
{ MODKEY|ControlMask, XK_F2, tagall, {.v = "2"} },
{ MODKEY|ControlMask, XK_F3, tagall, {.v = "3"} },
{ MODKEY|ControlMask, XK_F4, tagall, {.v = "4"} },
{ MODKEY|ControlMask, XK_F5, tagall, {.v = "5"} },
{ MODKEY|ControlMask, XK_F6, tagall, {.v = "6"} },
{ MODKEY|ControlMask, XK_F7, tagall, {.v = "7"} },
{ MODKEY|ControlMask, XK_F8, tagall, {.v = "8"} },
{ MODKEY|ControlMask, XK_F9, tagall, {.v = "9"} },
#endif // TAGALL_PATCH
#if TAGALLMON_PATCH
{ MODKEY|Mod4Mask|ShiftMask, XK_comma, tagallmon, {.i = +1 } },
{ MODKEY|Mod4Mask|ShiftMask, XK_period, tagallmon, {.i = -1 } },

@ -98,6 +98,10 @@
#include "switchcol.c"
#endif
#if TAGALL_PATCH
#include "tagall.c"
#endif
#if TAGALLMON_PATCH
#include "tagallmon.c"
#endif

@ -98,6 +98,10 @@
#include "switchcol.h"
#endif
#if TAGALL_PATCH
#include "tagall.h"
#endif
#if TAGALLMON_PATCH
#include "tagallmon.h"
#endif

@ -0,0 +1,25 @@
void
tagall(const Arg *arg)
{
if (!selmon->clients)
return;
/* if parameter starts with F, just move floating windows */
int floating_only = (char *)arg->v && ((char *)arg->v)[0] == 'F' ? 1 : 0;
int tag = (char *)arg->v ? atoi(((char *)arg->v) + floating_only) : 0;
int j;
Client* c;
if (tag >= 0 && tag < LENGTH(tags))
for (c = selmon->clients; c; c = c->next)
{
if (!floating_only || c->isfloating)
for (j = 0; j < LENGTH(tags); j++)
{
if (c->tags & 1 << j && selmon->tagset[selmon->seltags] & 1 << j)
{
c->tags = c->tags ^ (1 << j & TAGMASK);
c->tags = c->tags | 1 << (tag-1);
}
}
}
arrange(selmon);
}

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

@ -316,6 +316,11 @@
*/
#define SWITCHTAG_PATCH 0
/* Adds keyboard shortcuts to move all (or only floating) windows from one tag to another.
* https://dwm.suckless.org/patches/tagall/
*/
#define TAGALL_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
*/

Loading…
Cancel
Save