dwm

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

commit 1fba8d00cbd6bf8376a7448917ee13a5ba6d2d2d
parent 21e2d07c92e165f2485e9e37ce936c54b78b7040
Author: kocotian <kocotian@kocotian.pl>
Date:   Sun,  3 Jan 2021 19:40:25 +0100

removed testing puts, better "blocks"

Diffstat:
Mdwm.c | 34++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/dwm.c b/dwm.c @@ -931,10 +931,8 @@ copyvalidchars(char *text, char *rawtext) int i = -1, j = 0; while(rawtext[++i]) { - if ((unsigned char)rawtext[i] >= ' ') { + if ((unsigned char)rawtext[i] >= ' ') text[j++] = rawtext[i]; - if (rawtext[i] == 127) puts("COPYING 127"); - } } text[j] = '\0'; } @@ -1055,7 +1053,7 @@ drawbar(Monitor *m) drw_setscheme(drw, scheme[qscheme]); tmpch = *qptr; *qptr = '\0'; - drw_text(drw, (m->ww - tw) + xoffset, 0, drw_fontset_getwidth(drw, (ntext)), bh, 0, ntext, 0); + drw_text(drw, (m->ww - tw) + xoffset, 0 + 2, drw_fontset_getwidth(drw, (ntext)), bh - 2, 0, ntext, 0); if (qscheme == SchemeStatus) drw_setscheme(drw, scheme[StatusLn]); drw_rect(drw, (m->ww - tw) + xoffset + 1, 0, drw_fontset_getwidth(drw, (ntext)) - 2, 2, 1, 0); @@ -1075,7 +1073,7 @@ drawbar(Monitor *m) } } if (!drawn) { - drw_text(drw, (m->ww - tw), 0, tw, bh, 0, stext, 0); + drw_text(drw, (m->ww - tw), 0 + 2, tw, bh - 2, 0, stext, 0); drw_rect(drw, (m->ww - tw) + 1, 0, TEXTW(ntext) - 2, 2, 1, 1); } xoffset = drawn = 0; @@ -1090,7 +1088,7 @@ drawbar(Monitor *m) for (i = 0; i < LENGTH(tags); i++) { w = TEXTW(tags[i]); drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagsSel : SchemeTagsNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); + drw_text(drw, x, 0 + 2, w, bh - 2, lrpad / 2, tags[i], urg & 1 << i); drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagLnSel : (occ & 1 << i) ? SchemeTagLnOcc : SchemeTagLnNorm]); drw_rect(drw, x + 1, 0, w - 2, 2, m == selmon && selmon->sel && selmon->sel->tags & 1 << i, @@ -1102,12 +1100,16 @@ drawbar(Monitor *m) barwin, after ltsymbol */ w = blw = TEXTW(m->ltsymbol); + drw_setscheme(drw, scheme[SchemeTagLnNorm]); + drw_rect(drw, x + 1, 0, w - 2, 2, 1, 1); drw_setscheme(drw, scheme[SchemeTagsNorm]); - x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); + x = drw_text(drw, x, 0 + 2, w, bh - 2, lrpad / 2, m->ltsymbol, 0); w = blw = TEXTW(m->attsymbol); + drw_setscheme(drw, scheme[SchemeTagLnNorm]); + drw_rect(drw, x + 1, 0, w - 2, 2, 1, 1); drw_setscheme(drw, scheme[SchemeTagsNorm]); - x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->attsymbol, 0); + x = drw_text(drw, x, 0 + 2, w, bh - 2, lrpad / 2, m->attsymbol, 0); if ((w = m->ww - tw - x) > bh) { if (m->sel) { @@ -1116,16 +1118,21 @@ drawbar(Monitor *m) /* make sure name will not overlap on tags even when it is very long */ mid = mid >= lrpad / 2 ? mid : lrpad / 2; drw_setscheme(drw, scheme[m == selmon ? SchemeInfoSel : SchemeInfoNorm]); - drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0); - if (m->sel->isfloating) - drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); + drw_text(drw, x, 0 + 2, w, bh - 2, mid, m->sel->name, 0); + drw_setscheme(drw, scheme[m->sel->isfloating ? SchemeTagLnSel : SchemeTagLnNorm]); + drw_rect(drw, x + 1, 0, w - 2, 2, 1, 1); + /* if (m->sel->isfloating) */ + /* drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); */ } else { drw_setscheme(drw, scheme[SchemeInfoNorm]); drw_rect(drw, x, 0, w, bh, 1, 1); } } + drw_map(drw, m->barwin, 0, 0, m->ww, bh); + drw_setscheme(drw, scheme[SchemeNorm]); + 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]); /* drw_text(drw, 0, 0, mons->ww, bh, 0, estext, 0); */ @@ -1168,12 +1175,11 @@ drawbar(Monitor *m) } xoffset = drawn = 0; - drw_map(drw, m->extrabarwin, 0, 0, m->ww, bh); } else { drw_setscheme(drw, scheme[SchemeNorm]); - drw_text(drw, 0, 0, mons->ww, bh, 0, "", 0); - drw_map(drw, m->extrabarwin, 0, 0, m->ww, bh); + drw_text(drw, 0, 0 + 2, mons->ww, bh - 2, 0, "", 0); } + drw_map(drw, m->extrabarwin, 0, 0, m->ww, bh); } void