Adding distributetags patch

This commit is contained in:
bakkeby 2021-04-06 12:47:38 +02:00
parent 905dc4d7af
commit 0c88a49e27
7 changed files with 37 additions and 0 deletions

View File

@ -15,6 +15,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### Changelog: ### Changelog:
2021-04-06 - Added the distributetags patch
2021-04-04 - Added option for having different gaps on a per tag basis 2021-04-04 - Added option for having different gaps on a per tag basis
2021-03-31 - Added tapresize patch (contributed by [verschmelzen](https://github.com/verschmelzen)) 2021-03-31 - Added tapresize patch (contributed by [verschmelzen](https://github.com/verschmelzen))
@ -282,6 +284,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
- some applications use this property to notify window managers to not draw window decorations - some applications use this property to notify window managers to not draw window decorations
- not respecting this property leads to issues with applications that draw their own borders, like chromium (with "Use system title bar and borders" turned off) or vlc in fullscreen mode - not respecting this property leads to issues with applications that draw their own borders, like chromium (with "Use system title bar and borders" turned off) or vlc in fullscreen mode
- [distributetags](https://dwm.suckless.org/patches/reorganizetags/)
- this reorganisetags variant re-distributes all clients on the current monitor evenly across all tags
- [dmenumatchtop](https://dwm.suckless.org/patches/dmenumatchtop) - [dmenumatchtop](https://dwm.suckless.org/patches/dmenumatchtop)
- updates the position of dmenu to match that of the bar - updates the position of dmenu to match that of the bar
- i.e. if topbar is 0 then dmenu will appear at the bottom and if 1 then dmenu will appear at the top - i.e. if topbar is 0 then dmenu will appear at the bottom and if 1 then dmenu will appear at the top

View File

@ -869,6 +869,9 @@ static Key keys[] = {
#if REORGANIZETAGS_PATCH #if REORGANIZETAGS_PATCH
{ MODKEY|ControlMask, XK_r, reorganizetags, {0} }, { MODKEY|ControlMask, XK_r, reorganizetags, {0} },
#endif // REORGANIZETAGS_PATCH #endif // REORGANIZETAGS_PATCH
#if DISTRIBUTETAGS_PATCH
{ MODKEY|ControlMask, XK_d, distributetags, {0} },
#endif // DISTRIBUTETAGS_PATCH
#if INSETS_PATCH #if INSETS_PATCH
{ MODKEY|ShiftMask|ControlMask, XK_a, updateinset, {.v = &default_inset } }, { MODKEY|ShiftMask|ControlMask, XK_a, updateinset, {.v = &default_inset } },
#endif // INSETS_PATCH #endif // INSETS_PATCH

16
patch/distributetags.c Normal file
View File

@ -0,0 +1,16 @@
void
distributetags(const Arg *arg)
{
unsigned int ui = 1;
int i = 0;
for (Client *c = selmon->clients; c; c = c->next) {
if (HIDDEN(c))
continue;
if (!(c->tags & TAGMASK))
continue;
c->tags = (ui << i) & TAGMASK;
i = (i + 1) % NUMTAGS;
}
focus(NULL);
arrange(selmon);
}

1
patch/distributetags.h Normal file
View File

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

View File

@ -112,6 +112,9 @@
#if DECORATION_HINTS_PATCH #if DECORATION_HINTS_PATCH
#include "decorationhints.c" #include "decorationhints.c"
#endif #endif
#if DISTRIBUTETAGS_PATCH
#include "distributetags.c"
#endif
#if DRAGCFACT_PATCH && CFACTS_PATCH #if DRAGCFACT_PATCH && CFACTS_PATCH
#include "dragcfact.c" #include "dragcfact.c"
#endif #endif

View File

@ -109,6 +109,9 @@
#if DECORATION_HINTS_PATCH #if DECORATION_HINTS_PATCH
#include "decorationhints.h" #include "decorationhints.h"
#endif #endif
#if DISTRIBUTETAGS_PATCH
#include "distributetags.h"
#endif
#if DRAGCFACT_PATCH && CFACTS_PATCH #if DRAGCFACT_PATCH && CFACTS_PATCH
#include "dragcfact.h" #include "dragcfact.h"
#endif #endif

View File

@ -445,6 +445,12 @@
*/ */
#define DECORATION_HINTS_PATCH 0 #define DECORATION_HINTS_PATCH 0
/* This feature distributes all clients on the current monitor evenly across all tags.
* It is a variant of the reorganizetags patch.
* https://dwm.suckless.org/patches/reorganizetags/
*/
#define DISTRIBUTETAGS_PATCH 0
/* Similarly to the dragmfact patch this allows you to click and drag clients to change the /* Similarly to the dragmfact patch this allows you to click and drag clients to change the
* cfact to adjust the client's size in the stack. This patch depends on the cfacts patch. * cfact to adjust the client's size in the stack. This patch depends on the cfacts patch.
*/ */