Introduction
Introduction Statistics Contact Development Disclaimer Help
dwm-centeredwindowname-20190907-cb3f58a.diff - sites - public wiki contents of …
git clone git://git.suckless.org/sites
Log
Files
Refs
---
dwm-centeredwindowname-20190907-cb3f58a.diff (1129B)
---
1 From 9cff68c93cb727e97fa486f011b294511e110176 Mon Sep 17 00:00:00 2001
2 From: MahouShoujoMivutilde <[email protected]…
3 Date: Sat, 7 Sep 2019 20:04:16 +0300
4 Subject: [PATCH] Centers windows names on status bar.
5
6 In original version when name is very long mid variable can turn negativ…
7 ---
8 dwm.c | 5 ++++-
9 1 file changed, 4 insertions(+), 1 deletion(-)
10
11 diff --git a/dwm.c b/dwm.c
12 index 4465af1..3d0eac4 100644
13 --- a/dwm.c
14 +++ b/dwm.c
15 @@ -730,8 +730,11 @@ drawbar(Monitor *m)
16
17 if ((w = m->ww - sw - x) > bh) {
18 if (m->sel) {
19 + int mid = (m->ww - TEXTW(m->sel->name)) / 2 - x;
20 + /* make sure name will not overlap on tags even…
21 + mid = mid >= lrpad / 2 ? mid : lrpad / 2;
22 drw_setscheme(drw, scheme[m == selmon ? SchemeS…
23 - drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->n…
24 + drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0…
25 if (m->sel->isfloating)
26 drw_rect(drw, x + boxs, boxs, boxw, box…
27 } else {
28 --
29 2.23.0
30
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.