From 79176c73bd70292a52739b6c3ff8a354b084a67c Mon Sep 17 00:00:00 2001 From: Malfurious Date: Thu, 27 Jan 2022 22:21:27 -0500 Subject: patch: rearrangebar From the original patch: Rearrange bar so that the tiling method symbol is at the right of the bar and the window title is in the middle. This commit is a version I modified which omits the window title from the bar. For better synergy with the taglabels patch. --- dwm.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'dwm.c') diff --git a/dwm.c b/dwm.c index d163d0b..2af7979 100644 --- a/dwm.c +++ b/dwm.c @@ -759,15 +759,20 @@ drawbar(Monitor *m) int boxw = drw->fonts->h / 6 + 2; unsigned int i, occ = 0, urg = 0; Client *c; + w = blw = TEXTW(m->ltsymbol); + + /* clear bar from last draw */ + drw_setscheme(drw, scheme[SchemeNorm]); + drw_rect(drw, 0, 0, m->ww, bh, lrpad / 2, 1); if (!m->showbar) return; /* draw status first so it can be overdrawn by tags later */ if (m == selmon) { /* status is only drawn on selected monitor */ - drw_setscheme(drw, scheme[SchemeNorm]); - tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ + tw = TEXTW(stext) - lrpad + w; /* right padding for the tiling symbol */ drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0); + drw_text(drw, m->ww - w, 0, w, bh, lrpad / 2, m->ltsymbol, 0); } for (c = m->clients; c; c = c->next) { @@ -786,14 +791,14 @@ drawbar(Monitor *m) drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); x += w; } - w = TEXTW(m->ltsymbol); drw_setscheme(drw, scheme[SchemeNorm]); - x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); + x = m->ww/3; + /* if ((w = m->ww - tw - x) > bh) { if (m->sel) { drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); + drw_text(drw, x, 0, m->ww/3, bh, lrpad / 2, m->sel->name, 0); if (m->sel->isfloating) drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); } else { @@ -801,6 +806,7 @@ drawbar(Monitor *m) drw_rect(drw, x, 0, w, bh, 1, 1); } } + */ drw_map(drw, m->barwin, 0, 0, m->ww, bh); } -- cgit v1.2.3