[wiki] [sites] [dwm][patch] centretitle: add a new patch || fc

From: <git_AT_suckless.org>
Date: Mon, 07 Sep 2020 14:15:37 +0200

commit 33cee714e73a6cbc0df85e7dea2eda27dfa89833
Author: fc <sryvk.pura_AT_protonmail.com>
Date: Mon Sep 7 21:15:25 2020 +0900

    [dwm][patch] centretitle: add a new patch

diff --git a/dwm.suckless.org/patches/centretitle/dwm-centretitle-20200907-61bb8b2.diff b/dwm.suckless.org/patches/centretitle/dwm-centretitle-20200907-61bb8b2.diff
new file mode 100644
index 00000000..17983e85
--- /dev/null
+++ b/dwm.suckless.org/patches/centretitle/dwm-centretitle-20200907-61bb8b2.diff
_AT_@ -0,0 +1,38 @@
+From fe22e3d1434be1819fe0c0200d4a20967b02f3f6 Mon Sep 17 00:00:00 2001
+From: Felix Chen <sryvk.pura_AT_protonmail.com>
+Date: Mon, 7 Sep 2020 11:45:01 +0800
+Subject: [PATCH] Place title in the middle of barwin
+
+---
+ dwm.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/dwm.c b/dwm.c
+index 664c527..23e94f5 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -697,6 +697,7 @@ void
+ drawbar(Monitor *m)
+ {
+ int x, w, tw = 0;
++ int tlpad;
+ int boxs = drw->fonts->h / 9;
+ int boxw = drw->fonts->h / 6 + 2;
+ unsigned int i, occ = 0, urg = 0;
+_AT_@ -732,9 +733,11 @@ drawbar(Monitor *m)
+ if ((w = m->ww - tw - x) > bh) {
+ if (m->sel) {
+ drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
+- drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
++ tlpad = MAX((m->ww - ((int)TEXTW(m->sel->name) - lrpad)) / 2 - x, lrpad / 2);
++ drw_text(drw, x, 0, w, bh, tlpad, m->sel->name, 0);
+ if (m->sel->isfloating)
+- drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
++ drw_rect(drw, x + boxs + tlpad - lrpad / 2, boxs,
++ boxw, boxw, m->sel->isfixed, 0);
+ } else {
+ drw_setscheme(drw, scheme[SchemeNorm]);
+ drw_rect(drw, x, 0, w, bh, 1, 1);
+--
+2.28.0
+
diff --git a/dwm.suckless.org/patches/centretitle/index.md b/dwm.suckless.org/patches/centretitle/index.md
new file mode 100644
index 00000000..4190884d
--- /dev/null
+++ b/dwm.suckless.org/patches/centretitle/index.md
_AT_@ -0,0 +1,14 @@
+centretitle
+============
+
+Description
+-----------
+Place the title of focused client in the middle of barwin.
+
+Download
+--------
+* [dwm-centretitle-20200907-61bb8b2.diff](dwm-centretitle-20200907-61bb8b2.diff)
+
+Authors
+-------
+* Felix Chen - `<sryvk.pura_AT_protonmail.com>`
Received on Mon Sep 07 2020 - 14:15:37 CEST

This archive was generated by hypermail 2.3.0 : Mon Sep 07 2020 - 14:24:42 CEST