summaryrefslogtreecommitdiff
path: root/dwm/patch/distributetags.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwm/patch/distributetags.c')
-rwxr-xr-xdwm/patch/distributetags.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/dwm/patch/distributetags.c b/dwm/patch/distributetags.c
new file mode 100755
index 0000000..d786774
--- /dev/null
+++ b/dwm/patch/distributetags.c
@@ -0,0 +1,31 @@
+void
+distributetags(const Arg *arg)
+{
+ Client *c;
+ unsigned int ui = 1;
+ int i = 0;
+
+ #if TAGSYNC_PATCH
+ Monitor *origselmon = selmon;
+ for (selmon = mons; selmon; selmon = selmon->next) {
+ #endif // TAGSYNC_PATCH
+
+ for (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;
+ }
+
+ #if TAGSYNC_PATCH
+ }
+ selmon = origselmon;
+ arrange(NULL);
+ focus(NULL);
+ #else
+ arrange(selmon);
+ focus(NULL);
+ #endif // TAGSYNC_PATCH
+}