aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkolunmi <kolunmi@tutanota.com>2023-02-14 19:25:32 -0700
committerkolunmi <kolunmi@tutanota.com>2023-02-14 19:25:32 -0700
commit5d59643d3c04d04563f0d414619972b8a524e4f7 (patch)
treea5db265efc2fa011a6feba3da96d45a76e23f48d
parentc1362d5ff1b1dcb6bd037e3358ca346655aa0bcc (diff)
downloaddwlb-5d59643d3c04d04563f0d414619972b8a524e4f7.tar.gz
add vertical_padding setting
-rw-r--r--config.def.h3
-rw-r--r--dwlb.c9
2 files changed, 10 insertions, 2 deletions
diff --git a/config.def.h b/config.def.h
index e7349f9..47332c1 100644
--- a/config.def.h
+++ b/config.def.h
@@ -18,3 +18,6 @@ static pixman_color_t inactive_fg_color = { .red = 0xbbbb, .green = 0xbbbb, .blu
static pixman_color_t inactive_bg_color = { .red = 0x2222, .green = 0x2222, .blue = 0x2222, .alpha = 0xffff, };
static pixman_color_t urgent_fg_color = { .red = 0x2222, .green = 0x2222, .blue = 0x2222, .alpha = 0xffff, };
static pixman_color_t urgent_bg_color = { .red = 0xeeee, .green = 0xeeee, .blue = 0xeeee, .alpha = 0xffff, };
+
+// vertical pixel padding above and below text
+static uint32_t vertical_padding = 1;
diff --git a/dwlb.c b/dwlb.c
index 444f231..f9e9f6a 100644
--- a/dwlb.c
+++ b/dwlb.c
@@ -63,13 +63,14 @@
" -bottom bars will initially be drawn at the bottom\n" \
" -no-bottom bars will initially be drawn at the top\n" \
" -font [FONT] specify a font\n" \
+ " -tags [FIRST TAG]...[LAST TAG] specify custom tag names\n" \
+ " -vertical-padding [PIXELS] specify vertical pixel padding above and below text\n" \
" -active-fg-color [COLOR] specify text color of active tags or monitors\n" \
" -active-bg-color [COLOR] specify background color of active tags or monitors\n" \
" -inactive-fg-color [COLOR] specify text color of inactive tags or monitors\n" \
" -inactive-fg-color [COLOR] specify background color of inactive tags or monitors\n" \
" -urgent-fg-color [COLOR] specify text color of urgent tags\n" \
" -urgent-bg-color [COLOR] specify background color of urgent tags\n" \
- " -tags [FIRST TAG]...[LAST TAG] specify custom tag names\n" \
"Commands\n" \
" -status [OUTPUT] [TEXT] set status text\n" \
" -show [OUTPUT] show bar\n" \
@@ -1048,6 +1049,10 @@ main(int argc, char **argv)
if (++i >= argc)
DIE("Option -font requires an argument");
fontstr = argv[i];
+ } else if (!strcmp(argv[i], "-vertical-padding")) {
+ if (++i >= argc)
+ DIE("Option -vertical-padding requires an argument");
+ vertical_padding = atoi(argv[i]);
} else if (!strcmp(argv[i], "-active-fg-color")) {
if (++i >= argc)
DIE("Option -active-fg-color requires an argument");
@@ -1113,7 +1118,7 @@ main(int argc, char **argv)
if (!font)
DIE("Could not load font");
textpadding = font->height / 2;
- height = font->ascent + font->descent;
+ height = font->height + vertical_padding * 2;
/* Setup bars */
DL_FOREACH(bars, b)