diff options
author | Jackson Taylor <jtaylormuffins@gmail.com> | 2020-07-05 03:06:26 +0000 |
---|---|---|
committer | Jackson Taylor <jtaylor@classicalconversations.com> | 2022-02-07 10:19:29 -0500 |
commit | 36aa2d70be3ac8a2b0add76c158be5452caa6aab (patch) | |
tree | ad62a8fbde598741d2aeaa3548ed90bb7add3878 /dwm.c | |
parent | c9f179efd41ae6c5878e80db42cfc1a5de8903a5 (diff) |
Add centered window name patch
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -754,8 +754,11 @@ drawbar(Monitor *m) if ((w = m->ww - tw - x) > bh) { if (m->sel) { + int mid = (m->ww - TEXTW(m->sel->name)) / 2 - x; + /* 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 ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); + 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); } else { |