dwm

my heavily-patched and customized dwm build
git clone git://git.kocotian.pl/dwm.git
Log | Files | Refs | README | LICENSE

commit 6ff34615ee9bf58efaaf15e9118311c133ef27af
parent 653721f1a8efbc5a69d5f2f1d93c9d7fca876f46
Author: kocotian <kocotian@kocotian.pl>
Date:   Wed, 24 Feb 2021 19:40:08 +0100

gaps in bstack, few changes

Diffstat:
Mconfig.def.h | 15++++++++-------
Mdwm.c | 45+++++++++++++++++++++++++++++++++++----------
2 files changed, 43 insertions(+), 17 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -12,12 +12,12 @@ static const unsigned int igappx = 3; /* inner gaps */ static const int swallowfloating = 0; /* 1 means swallow floating windows by default */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ -static const char statussep = ';'; /* separator between status bars */ static const int barheight = 25; /* height of a bar; 0 equals autocalculation */ static const int attachdirection = 0; /* 0 default, 1 above, 2 aside, 3 below, 4 bottom, 5 top */ static const int centerwindowname = 0; /* 0 means window name on the left */ -static const char *fonts[] = { "monospace:size=8", "JoyPixels:pixelsize=10:antialias=true:autohint=true" }; -static const char dmenufont[] = "monospace:size=8"; +static const char statussep = ';'; /* separator between status bars */ +static const char *fonts[] = { "monospace:size=8:antialias=true:autohint=true", "JoyPixels:pixelsize=10:antialias=true:autohint=true" }; +static const char dmenufont[] = "monospace:size=8:antialias=true:autohint=true"; /* static const char col_gray1[] = "#222222"; */ /* static const char col_gray2[] = "#444444"; */ @@ -104,22 +104,23 @@ static const Rule rules[] = { { "st", NULL, NULL, 0 << 0, 0, 1, 0, -1 }, { "St", NULL, NULL, 0 << 0, 0, 1, 0, -1 }, { "Gimp", NULL, NULL, 1 << 8, 0, 0, 0, -1 }, + { "Mumble", NULL, NULL, 1 << 8, 0, 0, 0, 1 }, { "discord", NULL, NULL, 1 << 7, 0, 1, 0, -1 }, { "st-256color", NULL, NULL, 0 << 0, 0, 1, 0, -1 }, - { "Pulseeffects", NULL, NULL, 1 << 8, 0, 0, 0, 1 }, { "TelegramDesktop", NULL, NULL, 1 << 6, 0, 0, 0, -1 }, + { "Microsoft Teams - Preview", NULL, NULL, 1 << 0, 0, 0, 0, 1 }, { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, }; /* layout(s) */ static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 1; /* number of clients in master area */ +static const int nmaster = 2; /* number of clients in master area */ static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ static const Layout layouts[] = { /* symbol arrange function */ - { "[]=", tile }, /* first entry is default */ - { "TTT", bstack }, + { "TTT", bstack }, /* first entry is default */ + { "[]=", tile }, { "===", bstackhoriz }, { "[M]", monocle }, { "|M|", centeredmaster }, diff --git a/dwm.c b/dwm.c @@ -1135,6 +1135,7 @@ drawbar(Monitor *m) drw_map(drw, m->barwin, 0, 0, m->ww, bh); drw_setscheme(drw, scheme[SchemeNorm]); + drw_rect(drw, 0, 0, mons->ww, bh, 1, 1); drw_text(drw, 0, 0, mons->ww, bh, 0, "", 0); if (m == selmon) { /* extra status is only drawn on selected monitor */ drw_setscheme(drw, scheme[SchemeNorm]); @@ -1183,6 +1184,7 @@ drawbar(Monitor *m) drw_text(drw, 0, 2, mons->ww, dbh, 0, "", 0); } drw_map(drw, m->extrabarwin, 0, 0, m->ww, bh); + drw_rect(drw, 0, 0, mons->ww, bh, 1, 1); } void @@ -2569,18 +2571,27 @@ tile(Monitor *m) if (i < m->nmaster) { h = (m->wh - my) * (c->cfact / mfacts); if (n <= m->nmaster) - resize(c, m->wx + (!m->smartgaps*m->ogappx), m->wy + my + (!m->smartgaps*m->ogappx), mw - (2*c->bw) - (!m->smartgaps*(2*m->ogappx)), h - (2*c->bw) - (!m->smartgaps*(2*m->ogappx)), 0); + resize(c, m->wx + (!m->smartgaps*m->ogappx), + m->wy + my + (!m->smartgaps*m->ogappx), + mw - (2*c->bw) - (!m->smartgaps*(2*m->ogappx)), + h - (2*c->bw) - (!m->smartgaps*(2*m->ogappx)), 0); else - resize(c, m->wx + m->ogappx, m->wy + my + m->ogappx, mw - (2*c->bw) - m->ogappx - m->igappx, h - (2*c->bw) - (2*m->ogappx), 0); + resize(c, m->wx + m->ogappx, + m->wy + my + m->ogappx, + mw - (2*c->bw) - m->ogappx - m->igappx, + h - (2*c->bw) - (2*m->ogappx), 0); if (my + HEIGHT(c) < m->wh) my += HEIGHT(c) + (2*m->igappx); - mfacts -= c->cfact; + mfacts -= c->cfact; } else { h = (m->wh - ty) * (c->cfact / sfacts); - resize(c, m->wx + mw + m->igappx, m->wy + ty + m->ogappx, m->ww - mw - (2*c->bw) - m->ogappx - m->igappx, h - (2*c->bw) - (2*m->ogappx), 0); + resize(c, m->wx + mw + m->igappx, + m->wy + ty + m->ogappx, + m->ww - mw - (2*c->bw) - m->ogappx - m->igappx, + h - (2*c->bw) - (2*m->ogappx), 0); if (ty + HEIGHT(c) < m->wh) ty += HEIGHT(c) + (2*m->igappx); - sfacts -= c->cfact; + sfacts -= c->cfact; } } @@ -3306,7 +3317,8 @@ bstack(Monitor *m) } if (n == 0) return; - if(n == 1){ + + if (n == 1) { c = nexttiled(m->clients); resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); return; @@ -3319,15 +3331,28 @@ bstack(Monitor *m) for (i = 0, mx = tx = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) if (i < m->nmaster) { w = (m->ww - mx) * (c->cfact / mfacts); - resize(c, m->wx + mx, m->wy, w - (2*c->bw), mh - 2*c->bw, 0); + if (n <= m->nmaster) + resize(c, m->wx + mx + m->ogappx, + m->wy + m->ogappx, + w - (2*c->bw) - (2*m->ogappx), + mh - 2*c->bw - (2*m->ogappx), 0); + else + resize(c, m->wx + mx + m->ogappx, + m->wy + m->ogappx, + w - (2*c->bw) - (2*m->ogappx), + mh - 2*c->bw - m->ogappx, 0); if(mx + WIDTH(c) < m->mw) - mx += WIDTH(c); + mx += WIDTH(c) + (2*m->igappx); mfacts -= c->cfact; } else { w = (m->ww - tx) * (c->cfact / sfacts); - resize(c, m->wx + tx, m->wy + mh, w - (2*c->bw), m->wh - mh - 2*(c->bw), 0); + resize(c, m->wx + tx + m->ogappx, + m->wy + mh + (2*m->igappx), + w - (2*c->bw) - (2*m->ogappx), + m->wh - mh - (2*c->bw) - (2*m->igappx) - m->ogappx, + 0); if(tx + WIDTH(c) < m->mw) - tx += WIDTH(c); + tx += WIDTH(c) + (2*m->igappx); sfacts -= c->cfact; } }