dwm

git clone git://mattcarlson.org/repos/dwm.git
Log | Files | Refs

commit b70c27d9ccd89b4817303d501bd82b3c4a3fe4e8
parent 989761fe59377591a62d8248628514355bc8be46
Author: Matthew Carlson <matt@mcarlson.xyz>
Date:   Sun,  4 Jul 2021 00:52:11 +0000

Merge branch 'underline' into dwm

Diffstat:
Mconfig.h | 5+++++
Mdwm.c | 6++++++
2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/config.h b/config.h @@ -30,6 +30,11 @@ static const unsigned int alphas[][3] = { /* tagging */ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; +static const unsigned int ulinepad = 5; /* horizontal padding between the underline and tag */ +static const unsigned int ulinestroke = 2; /* thickness / height of the underline */ +static const unsigned int ulinevoffset = 0; /* how far above the bottom of the bar the line should appear */ +static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */ + static const Rule rules[] = { /* xprop(1): * WM_CLASS(STRING) = instance, class diff --git a/dwm.c b/dwm.c @@ -775,6 +775,12 @@ drawbar(Monitor *m) w = TEXTW(tags[i]); drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); + if (ulineall || m->tagset[m->seltags] & 1 << i) /* if there are conflicts, just move these lines directly underneath both 'drw_setscheme' and 'drw_text' :) */ + drw_rect(drw, x + ulinepad, bh - ulinestroke - ulinevoffset, w - (ulinepad * 2), ulinestroke, 1, 0); + if (occ & 1 << i) + drw_rect(drw, x + boxs, boxs, boxw, boxw, + m == selmon && selmon->sel && selmon->sel->tags & 1 << i, + urg & 1 << i); x += w; } w = blw = TEXTW(m->ltsymbol);