From dde75954fa94186d192b9a8c78dba7bbd040eb47 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 2 Mar 2024 15:12:21 -0500 Subject: patch: philcollins (full columns) Layout adapted from centerfloatingmaster to simply tile all clients horizontally across the screen, without respect to mfact or nmaster. --- dwm.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'dwm.c') diff --git a/dwm.c b/dwm.c index ddef5a6..bf0e19d 100644 --- a/dwm.c +++ b/dwm.c @@ -192,6 +192,7 @@ static void monocle(Monitor *m); static void motionnotify(XEvent *e); static void movemouse(const Arg *arg); static Client *nexttiled(Client *c); +static void philcollins(Monitor *m); static void pop(Client *c); static void propertynotify(XEvent *e); static void quit(const Arg *arg); @@ -1322,6 +1323,25 @@ nexttiled(Client *c) return c; } +void +philcollins(Monitor *m) +{ + unsigned int i, n, w, tx; + Client *c; + + /* count number of clients in the selected monitor */ + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + if (n == 0) + return; + + /* there are no masters, clients are stacked in columns horizontally */ + for (i = tx = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { + w = (m->ww - tx) / (n - i); + resize(c, m->wx + tx, m->wy, w - (2*c->bw), m->wh - (2*c->bw), 0); + tx += WIDTH(c); + } +} + void pop(Client *c) { -- cgit v1.2.3