commit: 6ea8b683de816b459da845acd91fca1da933a1f2
parent: 72aab71ae6e9911a866e0de1049451e983aedbfd
author: Chris Noxz <chris@noxz.tech>
date: Tue, 4 Feb 2020 18:33:16 +0100
Center client title
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dwm.c b/dwm.c
@@ -698,7 +698,7 @@ dirtomon(int dir)
void
drawbar(Monitor *m)
{
- int x, w, sw = 0;
+ int x, w, mid, sw = 0;
int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2;
unsigned int i, occ = 0, urg = 0;
@@ -733,8 +733,9 @@ drawbar(Monitor *m)
if ((w = m->ww - sw - x) > bh) {
if (m->sel) {
+ mid = (m->ww - TEXTW(m->sel->name)) / 2 - x;
drw_setscheme(drw, scheme[m == selmon ? SchemeTitleSel : SchemeTitleNorm]);
- 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 {