bar: 2024-06-26

This commit is contained in:
sewn
2024-06-26 10:06:11 +03:00
parent f92c23c607
commit 5ce3fdc2ed
8 changed files with 506 additions and 343 deletions
+2 -1
View File
@@ -3,7 +3,8 @@
Add vertical and horizontal space between the [bar](https://codeberg.org/dwl/dwl-patches/wiki/bar) and the edge of the screen.
### Download
- [2024-06-10](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/barpadding/barpadding.patch) (bar 2024-06-10)
- [git branch](https://codeberg.org/sewn/dwl/src/branch/barborder)
- [2024-06-26](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/barpadding/barpadding.patch) (bar 2024-06-26)
### Authors
- [sewn](https://codeberg.org/sewn)
+18 -18
View File
@@ -1,4 +1,4 @@
From 69af490e9ad6213463c043db736547bffddd77d2 Mon Sep 17 00:00:00 2001
From 504fb68dc63072b7184273c658f572bca1688996 Mon Sep 17 00:00:00 2001
From: sewn <sewn@disroot.org>
Date: Mon, 10 Jun 2024 16:33:52 +0300
Subject: [PATCH] add vertical and horizontal spacing to bar
@@ -10,23 +10,23 @@ https://dwm.suckless.org/patches/barpadding/
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/config.def.h b/config.def.h
index d0bb5bc..8dc2e85 100644
index 6024b7e..4d438ab 100644
--- a/config.def.h
+++ b/config.def.h
@@ -17,6 +17,8 @@ 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 vertpad = 10; /* vertical padding of bar */
+static const int sidepad = 10; /* horizontal padding of bar */
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 };
@@ -9,6 +9,8 @@ static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will
static const unsigned int borderpx = 1; /* border pixel of windows */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
+static const int vertpad = 10; /* vertical padding of bar */
+static const int sidepad = 10; /* horizontal padding of bar */
static const char *fonts[] = {"monospace:size=10"};
static const float rootcolor[] = COLOR(0x000000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
diff --git a/dwl.c b/dwl.c
index cd484bd..eec0dd7 100644
index 72b4abb..b26cb9c 100644
--- a/dwl.c
+++ b/dwl.c
@@ -572,8 +572,8 @@ arrangelayers(Monitor *m)
@@ -591,8 +591,8 @@ arrangelayers(Monitor *m)
return;
if (m->showbar) {
@@ -37,8 +37,8 @@ index cd484bd..eec0dd7 100644
}
/* Arrange exclusive surfaces from top->bottom */
@@ -1424,8 +1424,8 @@ drawbar(Monitor *m)
pixman_image_unref(pix);
@@ -1491,8 +1491,8 @@ drawbar(Monitor *m)
drwl_finish_drawing(m->drw);
wlr_scene_buffer_set_dest_size(m->scene_buffer,
m->b.real_width, m->b.real_height);
- wlr_scene_node_set_position(&m->scene_buffer->node, m->m.x,
@@ -48,7 +48,7 @@ index cd484bd..eec0dd7 100644
wlr_scene_buffer_set_buffer(m->scene_buffer, &buf->base);
wlr_buffer_drop(&buf->base);
}
@@ -3007,7 +3007,7 @@ updatebar(Monitor *m)
@@ -3067,7 +3067,7 @@ updatebar(Monitor *m)
char fontattrs[12];
wlr_output_transformed_resolution(m->wlr_output, &rw, &rh);
@@ -56,7 +56,7 @@ index cd484bd..eec0dd7 100644
+ m->b.width = rw - 2 * sidepad;
m->b.real_width = (int)((float)m->b.width / m->wlr_output->scale);
if (m->b.scale == m->wlr_output->scale && m->font)
if (m->b.scale == m->wlr_output->scale && m->drw)
--
2.45.0
2.45.2