[wiki] [sites] [dwm][PATCH] Configurable spacing in statusbar. || Christopher Drelich

From: <git_AT_suckless.org>
Date: Fri, 25 May 2018 07:17:17 +0200

commit cd8390121b099184010a1f0272f9c3ccccbee2f2
Author: Christopher Drelich <cd_AT_cdrakka.com>
Date: Fri May 25 01:16:30 2018 -0400

    [dwm][PATCH] Configurable spacing in statusbar.

diff --git a/dwm.suckless.org/patches/statuspadding/dwm-statuspadding-20150524-c8e9479.diff b/dwm.suckless.org/patches/statuspadding/dwm-statuspadding-20150524-c8e9479.diff
new file mode 100644
index 00000000..eab4bf90
--- /dev/null
+++ b/dwm.suckless.org/patches/statuspadding/dwm-statuspadding-20150524-c8e9479.diff
_AT_@ -0,0 +1,62 @@
+From 75d5edbe16ee2fc060ff8b05eea17791d6334a59 Mon Sep 17 00:00:00 2001
+From: Christopher Drelich <cd_AT_cdrakka.com>
+Date: Thu, 24 May 2018 23:24:12 -0400
+Subject: [PATCH] Replaces magic numbers in statusbar with configurable
+ variables.
+
+horizpadbar for horizontal statusbar padding
+vertpadbar for vertical statusbar padding
+
+StatusText now has both left and right padding,
+as well as the vertical padding that all of the statusbar shares.
+
+Other than the addition of left padding to StatusText, appearance
+of the statusbar is identical to pre-patch when using the defaults
+in config.def.h
+---
+ config.def.h | 2 ++
+ dwm.c | 8 ++++----
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index a9ac303..5819399 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -5,6 +5,8 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
+ static const unsigned int snap = 32; /* snap pixel */
+ static const int showbar = 1; /* 0 means no bar */
+ static const int topbar = 1; /* 0 means bottom bar */
++static const int horizpadbar = 2; /* horizontal padding for statusbar */
++static const int vertpadbar = 0; /* vertical padding for statusbar */
+ static const char *fonts[] = { "monospace:size=10" };
+ static const char dmenufont[] = "monospace:size=10";
+ static const char col_gray1[] = "#222222";
+diff --git a/dwm.c b/dwm.c
+index bb95e26..7b9ed42 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -704,8 +704,8 @@ drawbar(Monitor *m)
+ /* draw status first so it can be overdrawn by tags later */
+ if (m == selmon) { /* status is only drawn on selected monitor */
+ drw_setscheme(drw, scheme[SchemeNorm]);
+- sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
+- drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0);
++ sw = TEXTW(stext);
++ drw_text(drw, m->ww - sw, 0, sw, bh, lrpad / 2, stext, 0);
+ }
+
+ for (c = m->clients; c; c = c->next) {
+_AT_@ -1544,8 +1544,8 @@ setup(void)
+ drw = drw_create(dpy, screen, root, sw, sh);
+ if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
+ die("no fonts could be loaded.");
+- lrpad = drw->fonts->h;
+- bh = drw->fonts->h + 2;
++ lrpad = drw->fonts->h + horizpadbar;
++ bh = drw->fonts->h + vertpadbar;
+ updategeom();
+ /* init atoms */
+ utf8string = XInternAtom(dpy, "UTF8_STRING", False);
+--
+2.7.4
+
diff --git a/dwm.suckless.org/patches/statuspadding/index.md b/dwm.suckless.org/patches/statuspadding/index.md
new file mode 100644
index 00000000..180a85cf
--- /dev/null
+++ b/dwm.suckless.org/patches/statuspadding/index.md
_AT_@ -0,0 +1,26 @@
+# statuspadding
+
+## Description
+
+This makes the amount of horizontal and vertical padding in the status bar
+into configurable options.
+
+This padding is also applied to StatusText in an equal manner, as opposed t
+just right padding.
+
+The configurable options in config.def.h are:
+
+horizpadbar
+
+vertpadbar
+
+The defaults in config.def.h leave dwm with the same appearance as pre-patch
+except StatusText now has left padding in addition to right padding.
+
+## Download
+
+ * [dwm-statuspadding-20150524-c8e9479.diff](dwm-statuspadding-20150524-c8e9479.diff) (24.05.2018)
+
+## Author
+
+ * cd
Received on Fri May 25 2018 - 07:17:17 CEST

This archive was generated by hypermail 2.3.0 : Fri May 25 2018 - 07:24:23 CEST