add vertical_padding setting

This commit is contained in:
kolunmi 2023-02-14 19:25:32 -07:00
parent c1362d5ff1
commit 5d59643d3c
2 changed files with 10 additions and 2 deletions

View File

@ -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;

9
dwlb.c
View File

@ -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)