]> git.ekhem.eu.org Git - dwm.git/commitdiff
Patch statuspadding
authorJakub Czajka <jakub@ekhem.eu.org>
Fri, 1 Oct 2021 19:53:51 +0000 (21:53 +0200)
committerJakub Czajka <jakub@ekhem.eu.org>
Sat, 14 Oct 2023 20:46:25 +0000 (22:46 +0200)
config.def.h
config.h
dwm.c

index a1ef4f738bf626d4089f91b4fcd491fc7ac89911..b68c2efb90125c76bb9a3ae74905793bae4a8b1b 100644 (file)
@@ -6,6 +6,8 @@ static const unsigned int gappx     = 5;        /* gaps between 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";
index 0bf3e386875d3103b941adf3bcd941693ccfa22d..a6b9bfcc53ce185a2561d925e57680c2d7020825 100644 (file)
--- a/config.h
+++ b/config.h
@@ -6,6 +6,8 @@ static const unsigned int gappx     = 6;        /* gaps between 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        = 3;        /* 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 7cbd3c5d9ce99ad50bed94a6f80e007bd67b50d9..bab7282b596021ab5cb06fda1a51621f2fab485c 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -715,8 +715,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]);
-               tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
-               drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
+               tw = TEXTW(stext);
+               drw_text(drw, m->ww - tw, 0, tw, bh, lrpad / 2, stext, 0);
        }
 
        for (c = m->clients; c; c = c->next) {
@@ -1569,8 +1569,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);