summaryrefslogtreecommitdiff
path: root/dwm/patch/layout_monocle.c
diff options
context:
space:
mode:
authorcoasteen <coasteen@proton.me>2026-07-09 10:42:28 +0330
committercoasteen <coasteen@proton.me>2026-07-09 10:42:28 +0330
commit8cbadb61604667b407b53ee1258433994fa4765a (patch)
tree97765fb29418fd6278fcb4cbb9760893afaf7a58 /dwm/patch/layout_monocle.c
Diffstat (limited to 'dwm/patch/layout_monocle.c')
-rwxr-xr-xdwm/patch/layout_monocle.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/dwm/patch/layout_monocle.c b/dwm/patch/layout_monocle.c
new file mode 100755
index 0000000..f7b5bc3
--- /dev/null
+++ b/dwm/patch/layout_monocle.c
@@ -0,0 +1,38 @@
+#if VANITYGAPS_PATCH && VANITYGAPS_MONOCLE_PATCH
+void
+monocle(Monitor *m)
+{
+ unsigned int n;
+ int oh, ov, ih, iv;
+ Client *c;
+
+ getgaps(m, &oh, &ov, &ih, &iv, &n);
+
+ #if !MONOCLESYMBOL_PATCH
+ if (n > 0) /* override layout symbol */
+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
+ #endif // MONOCLESYMBOL_PATCH
+ for (c = nexttiled(m->clients); c; c = nexttiled(c->next))
+ resize(c, m->wx + ov, m->wy + oh, m->ww - 2 * c->bw - 2 * ov, m->wh - 2 * c->bw - 2 * oh, 0);
+}
+#else
+void
+monocle(Monitor *m)
+{
+ #if !MONOCLESYMBOL_PATCH
+ unsigned int n = 0;
+ #endif // MONOCLESYMBOL_PATCH
+ Client *c;
+
+ #if !MONOCLESYMBOL_PATCH
+ for (c = m->clients; c; c = c->next)
+ if (ISVISIBLE(c))
+ n++;
+ if (n > 0) /* override layout symbol */
+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
+ #endif // MONOCLESYMBOL_PATCH
+ for (c = nexttiled(m->clients); c; c = nexttiled(c->next))
+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0);
+}
+#endif // VANITYGAPS_PATCH
+