[download]

config/dwm/centeredwindowname.patch

   1 diff --git a/dwm.c b/dwm.c
   2 index 4465af1..3d0eac4 100644
   3 --- a/dwm.c
   4 +++ b/dwm.c
   5 @@ -730,8 +730,11 @@ drawbar(Monitor *m)
   6 
   7  	if ((w = m->ww - sw - x) > bh) {
   8  		if (m->sel) {
   9 +			int mid = (m->ww - TEXTW(m->sel->name)) / 2 - x;
  10 +			/* make sure name will not overlap on tags even when it is very long */
  11 +			mid = mid >= lrpad / 2 ? mid : lrpad / 2;
  12 -			drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
  13 +			drw_setscheme(drw, scheme[SchemeNorm]);
  14 -			drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
  15 +			drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0);
  16  			if (m->sel->isfloating)
  17 -				drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
  18 +				drw_rect(drw, x + boxs + mid - 8, boxs, boxw, boxw, m->sel->isfixed, 0);
  19  		} else {