dwl-patches/patches/barheight/barheight.patch

39 lines
1.3 KiB
Diff

From 0b471d8b8adbd79802beb035270f68c92465284c Mon Sep 17 00:00:00 2001
From: oak <oak@petrifiedoak.com>
Date: Mon, 10 Jun 2024 21:25:56 +0200
Subject: [PATCH] Implement barheight
---
config.def.h | 1 +
dwl.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
index c4ab801..869cb7a 100644
--- a/config.def.h
+++ b/config.def.h
@@ -17,6 +17,7 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca
/* bar */
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 dwl will calculate bar height, >= 1 means dwl will use user_bh as bar height */
static const char *fonts[] = {"monospace:size=10"};
static pixman_color_t normbarfg = { 0xbbbb, 0xbbbb, 0xbbbb, 0xffff };
static pixman_color_t normbarbg = { 0x2222, 0x2222, 0x2222, 0xffff };
diff --git a/dwl.c b/dwl.c
index 61c5727..49eded9 100644
--- a/dwl.c
+++ b/dwl.c
@@ -3037,7 +3037,7 @@ updatebar(Monitor *m)
m->b.scale = m->wlr_output->scale;
m->lrpad = m->font->height;
- m->b.height = m->font->height + 2;
+ m->b.height = user_bh ? user_bh : m->font->height + 2;
m->b.real_height = (int)((float)m->b.height / m->wlr_output->scale);
}
--
2.44.0