aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-03-27 15:34:46 +0300
committereug-vs <eug-vs@keemail.me>2021-03-27 15:34:46 +0300
commitbd2586ead2b8004e8c78819c4f7c57b9a1128b2e (patch)
treecd3345026b0b9d903e8d8c9ce28f35e9f74d4a23
parente65c6c005034c2deebaf4e942ffd66b4498f379a (diff)
downloaddwm-bd2586ead2b8004e8c78819c4f7c57b9a1128b2e.tar.gz
feat: add padding to statusbar
-rw-r--r--config.def.h2
-rw-r--r--dwm.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/config.def.h b/config.def.h
index 7d91fdc..6425727 100644
--- a/config.def.h
+++ b/config.def.h
@@ -5,6 +5,8 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int gappx = 28; /* gaps between windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
+static const int horizpadbar = 4; /* horizontal padding for statusbar */
+static const int vertpadbar = 4; /* vertical padding for statusbar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "monospace:size=10" };
static const char dmenufont[] = "monospace:size=10";
diff --git a/dwm.c b/dwm.c
index d090af8..ef65492 100644
--- a/dwm.c
+++ b/dwm.c
@@ -708,8 +708,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) {
@@ -1558,8 +1558,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);