From c3d368f1937465b5f2ba41ac65ef24e275146ff5 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Sun, 21 Jun 2020 20:04:56 +0200 Subject: [PATCH] Adding bar_height patch --- README.md | 5 ++++- config.def.h | 3 +++ dwm.c | 4 ++++ patches.def.h | 5 +++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c13433..5eb2158 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t ### Changelog: -2020-06-21 - Added floatpos patch +2020-06-21 - Added floatpos and bar_height patches 2020-06-19 - Added tagothermonitor patch @@ -164,6 +164,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t - [awesomebar](https://dwm.suckless.org/patches/awesomebar/) - enhanced taskbar that allows focus / hiding / unhiding of windows by clicking on the status bar + - [bar_height](https://dwm.suckless.org/patches/bar_height/) + - allows the bar height to be explicitly set rather than being derived from font + - [barpadding](https://dwm.suckless.org/patches/barpadding/) - adds vertical and horizontal space between the statusbar and the edge of the screen diff --git a/config.def.h b/config.def.h index 64ea4f5..6b11339 100644 --- a/config.def.h +++ b/config.def.h @@ -21,6 +21,9 @@ static const int showbar = 0; /* 0 means no bar */ static const int showbar = 1; /* 0 means no bar */ #endif // HOLDBAR_PATCH static const int topbar = 1; /* 0 means bottom bar */ +#if BAR_HEIGHT_PATCH +static const int bar_height = 0; /* 0 means derive from font, >= 1 explicit height */ +#endif // BAR_HEIGHT_PATCH #if BARPADDING_PATCH static const int vertpad = 10; /* vertical padding of bar */ static const int sidepad = 10; /* horizontal padding of bar */ diff --git a/dwm.c b/dwm.c index e4fccd9..6cc26d6 100644 --- a/dwm.c +++ b/dwm.c @@ -3103,7 +3103,11 @@ setup(void) bh = drw->font->h + 2; #else lrpad = drw->fonts->h; + #if BAR_HEIGHT_PATCH + bh = bar_height ? bar_height : drw->fonts->h + 2; + #else bh = drw->fonts->h + 2; + #endif // BAR_HEIGHT_PATCH #endif // STATUSPADDING_PATCH updategeom(); #if BARPADDING_PATCH diff --git a/patches.def.h b/patches.def.h index 5bf94d3..a847062 100644 --- a/patches.def.h +++ b/patches.def.h @@ -82,6 +82,11 @@ */ #define AWESOMEBAR_PATCH 0 +/* Allows the bar height to be explicitly set rather than being derived from font. + * https://dwm.suckless.org/patches/bar_height/ + */ +#define BAR_HEIGHT_PATCH 0 + /* This patch adds vertical and horizontal space between the statusbar and the edge of the screen. * https://dwm.suckless.org/patches/barpadding/ */