summaryrefslogtreecommitdiff
path: root/dwm/patch/toggletopbar.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/toggletopbar.c
Diffstat (limited to 'dwm/patch/toggletopbar.c')
-rwxr-xr-xdwm/patch/toggletopbar.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/dwm/patch/toggletopbar.c b/dwm/patch/toggletopbar.c
new file mode 100755
index 0000000..8ccc9ac
--- /dev/null
+++ b/dwm/patch/toggletopbar.c
@@ -0,0 +1,20 @@
+void
+toggletopbar(const Arg *arg)
+{
+ Bar *bar;
+ Monitor *m = selmon;
+
+ for (bar = m->bar; bar; bar = bar->next)
+ bar->topbar = !bar->topbar;
+
+ if (!m->showbar) {
+ togglebar(NULL);
+ return;
+ }
+
+ updatebarpos(m);
+
+ for (bar = m->bar; bar; bar = bar->next)
+ XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
+ arrange(m);
+}