sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-centeredwindowname-20180909-6.2.diff (804B)


      1 From bd6efd81eabab77c91a3e95b528b19db2d58525b Mon Sep 17 00:00:00 2001
      2 From: Sacules <leociancalucas@gmail.com>
      3 Date: Sun, 9 Sep 2018 17:12:58 -0300
      4 Subject: [PATCH] Centers windows names on status bar.
      5 
      6 ---
      7  dwm.c | 3 ++-
      8  1 file changed, 2 insertions(+), 1 deletion(-)
      9 
     10 diff --git a/dwm.c b/dwm.c
     11 index 4465af1..9d5ef7a 100644
     12 --- a/dwm.c
     13 +++ b/dwm.c
     14 @@ -730,8 +730,9 @@ drawbar(Monitor *m)
     15  
     16  	if ((w = m->ww - sw - x) > bh) {
     17  		if (m->sel) {
     18 +			int mid = (m->ww - TEXTW(m->sel->name)) / 2 - x;
     19  			drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
     20 -			drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
     21 +			drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0);
     22  			if (m->sel->isfloating)
     23  				drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
     24  		} else {
     25 -- 
     26 2.18.0
     27