aboutsummaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
authorBryson Steck <brysonsteck@protonmail.com>2022-10-26 11:43:53 -0600
committerBryson Steck <brysonsteck@protonmail.com>2022-10-26 11:43:53 -0600
commit5c838a427318a1feb3a7b8f72184d887ff821a02 (patch)
tree058f43fb6e442e381ff622332fbed2cf50d8f3b2 /dwm.c
parent3e7db78a19e50c7d629c5d1bc677cc386f32d2e7 (diff)
downloaddwm-5c838a427318a1feb3a7b8f72184d887ff821a02.tar
dwm-5c838a427318a1feb3a7b8f72184d887ff821a02.tar.gz
dwm-5c838a427318a1feb3a7b8f72184d887ff821a02.tar.bz2
add columns view, nerd font
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/dwm.c b/dwm.c
index e4f75a7..dbf29cb 100644
--- a/dwm.c
+++ b/dwm.c
@@ -154,6 +154,7 @@ static void checkotherwm(void);
static void cleanup(void);
static void cleanupmon(Monitor *mon);
static void clientmessage(XEvent *e);
+static void col(Monitor *);
static void configure(Client *c);
static void configurenotify(XEvent *e);
static void configurerequest(XEvent *e);
@@ -1694,6 +1695,32 @@ tagmon(const Arg *arg)
}
void
+col(Monitor *m)
+{
+ unsigned int i, n, h, w, x, y, mw;
+ Client *c;
+
+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+ if (n == 0)
+ return;
+
+ if (n > m->nmaster)
+ mw = m->nmaster ? m->ww * m->mfact : 0;
+ else
+ mw = m->ww;
+ for (i = x = y = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+ if (i < m->nmaster) {
+ w = (mw - x) / (MIN(n, m->nmaster) - i);
+ resize(c, x + m->wx, m->wy, w - (2 * c->bw), m->wh - (2 * c->bw), 0);
+ x += WIDTH(c);
+ } else {
+ h = (m->wh - y) / (n - i);
+ resize(c, x + m->wx, m->wy + y, m->ww - x - (2 * c->bw), h - (2 * c->bw), 0);
+ y += HEIGHT(c);
+ }
+}
+
+void
tile(Monitor *m)
{
unsigned int i, n, h, mw, my, ty;