From 523f55650600f94b7a2430389827460e57be5ca7 Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Thu, 31 Mar 2022 23:04:01 +0200 Subject: [PATCH] dwm - barheight plugin. --- _suckless/dwm/config.def.h | 1 + _suckless/dwm/config.h | 3 ++- _suckless/dwm/dwm.c | 2 +- .../dwm/patches/10-dwm-bar-height-6.2.diff | 25 +++++++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 _suckless/dwm/patches/10-dwm-bar-height-6.2.diff diff --git a/_suckless/dwm/config.def.h b/_suckless/dwm/config.def.h index 533b08e..0f966b6 100644 --- a/_suckless/dwm/config.def.h +++ b/_suckless/dwm/config.def.h @@ -13,6 +13,7 @@ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display static const int showsystray = 1; /* 0 means no systray */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ +static const int user_bh = 0; /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */ static const char *fonts[] = { "monospace:size=10" }; static const char dmenufont[] = "monospace:size=10"; static const char col_gray1[] = "#222222"; diff --git a/_suckless/dwm/config.h b/_suckless/dwm/config.h index aeed170..1154955 100644 --- a/_suckless/dwm/config.h +++ b/_suckless/dwm/config.h @@ -10,9 +10,10 @@ static const unsigned int systraypinning = 0; /* 0: sloppy systray follows sel static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */ static const unsigned int systrayspacing = 2; /* systray spacing */ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/ -static const int showsystray = 1; /* 0 means no systray */ +static const int showsystray = 1; /* 0 means no systray */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ +static const int user_bh = 20; /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */ static const char *fonts[] = { "RobotoMono Nerd Font:style=Medium:size=10", "Material Icons:size=12" }; static const char normfgcolor[] = "#bbbbbb"; static const char col_fg[] = "#c7c7c7"; diff --git a/_suckless/dwm/dwm.c b/_suckless/dwm/dwm.c index f952acc..8504943 100644 --- a/_suckless/dwm/dwm.c +++ b/_suckless/dwm/dwm.c @@ -1981,7 +1981,7 @@ setup(void) if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) die("no fonts could be loaded."); lrpad = drw->fonts->h; - bh = drw->fonts->h + 2; + bh = user_bh ? user_bh : drw->fonts->h + 2; updategeom(); /* init atoms */ utf8string = XInternAtom(dpy, "UTF8_STRING", False); diff --git a/_suckless/dwm/patches/10-dwm-bar-height-6.2.diff b/_suckless/dwm/patches/10-dwm-bar-height-6.2.diff new file mode 100644 index 0000000..a576111 --- /dev/null +++ b/_suckless/dwm/patches/10-dwm-bar-height-6.2.diff @@ -0,0 +1,25 @@ +diff --git a/config.def.h b/config.def.h +index 1c0b587..9814500 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -5,6 +5,7 @@ static const unsigned int borderpx = 1; /* border pixel of 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 user_bh = 0; /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */ + 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 4465af1..2c27cb3 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -1545,7 +1545,7 @@ setup(void) + if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) + die("no fonts could be loaded."); + lrpad = drw->fonts->h; +- bh = drw->fonts->h + 2; ++ bh = user_bh ? user_bh : drw->fonts->h + 2; + updategeom(); + /* init atoms */ + utf8string = XInternAtom(dpy, "UTF8_STRING", False);