diff options
author | Bryson Steck <brysonsteck@protonmail.com> | 2022-10-26 11:43:53 -0600 |
---|---|---|
committer | Bryson Steck <brysonsteck@protonmail.com> | 2022-10-26 11:43:53 -0600 |
commit | 5c838a427318a1feb3a7b8f72184d887ff821a02 (patch) | |
tree | 058f43fb6e442e381ff622332fbed2cf50d8f3b2 | |
parent | 3e7db78a19e50c7d629c5d1bc677cc386f32d2e7 (diff) | |
download | dwm-5c838a427318a1feb3a7b8f72184d887ff821a02.tar dwm-5c838a427318a1feb3a7b8f72184d887ff821a02.tar.gz dwm-5c838a427318a1feb3a7b8f72184d887ff821a02.tar.bz2 |
add columns view, nerd font
-rw-r--r-- | config.def.h | 2 | ||||
-rw-r--r-- | config.h | 6 | ||||
-rw-r--r-- | dwm.c | 27 |
3 files changed, 33 insertions, 2 deletions
diff --git a/config.def.h b/config.def.h index a2ac963..d9ebdba 100644 --- a/config.def.h +++ b/config.def.h @@ -42,6 +42,7 @@ static const Layout layouts[] = { { "[]=", tile }, /* first entry is default */ { "><>", NULL }, /* no layout function means floating behavior */ { "[M]", monocle }, + { "|||", col }, }; /* key definitions */ @@ -77,6 +78,7 @@ static Key keys[] = { { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, + { MODKEY, XK_c, setlayout, {.v = &layouts[3]} }, { MODKEY, XK_space, setlayout, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, { MODKEY, XK_0, view, {.ui = ~0 } }, @@ -6,8 +6,8 @@ static const unsigned int gappx = 8; /* gaps between windows */ static const unsigned int snap = 32; /* snap pixel */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ -static const char *fonts[] = { "JetBrains Mono:style=medium:size=11" }; -static const char dmenufont[] = "JetBrains Mono:stlye=medium:size=11"; +static const char *fonts[] = { "JetBrains Mono NF:style=medium:size=11" }; +static const char dmenufont[] = "JetBrains Mono NF:stlye=medium:size=11"; // gruvbox static const char fg[] = "#ebdbb2"; static const char bg_normal[] = "#3c3836"; @@ -56,6 +56,7 @@ static const Layout layouts[] = { { "[]=", tile }, /* first entry is default */ { "><>", NULL }, /* no layout function means floating behavior */ { "[M]", monocle }, + { "|||", col }, }; /* key definitions */ @@ -109,6 +110,7 @@ static Key keys[] = { { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, + { MODKEY, XK_c, setlayout, {.v = &layouts[3]} }, { MODKEY, XK_space, setlayout, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, { MODKEY, XK_0, view, {.ui = ~0 } }, @@ -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; |