diff options
author | Malfurious <m@lfurio.us> | 2022-01-27 22:21:27 -0500 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2023-06-03 22:08:17 -0400 |
commit | 79176c73bd70292a52739b6c3ff8a354b084a67c (patch) | |
tree | 4675554d0bbbc290dcc2d060c3144f5afa87fd3b | |
parent | e95d3939f4756fe81f1555a839835bb91e61f28d (diff) | |
download | dwm-79176c73bd70292a52739b6c3ff8a354b084a67c.tar.gz dwm-79176c73bd70292a52739b6c3ff8a354b084a67c.zip |
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.
-rw-r--r-- | dwm.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -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); } |