From 1bd8463481c5272094a084a76ab558a45e18bd15 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Wed, 28 Nov 2018 11:23:48 -0500 Subject: Implement bar gaps Adds the bar subcommand `gaps | | ` to set gaps for swaybar. Due to restrictions on margins for a layer_surface, only the sides that are anchored to an edge of the screen can have gaps. Since there is support for per-side outer gaps for workspaces, those should be able to be used instead for the last side. --- swaybar/render.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'swaybar/render.c') diff --git a/swaybar/render.c b/swaybar/render.c index 8269a840..77cfecbf 100644 --- a/swaybar/render.c +++ b/swaybar/render.c @@ -506,6 +506,11 @@ void render_frame(struct swaybar_output *output) { if (height != output->height || output->width == 0) { // Reconfigure surface zwlr_layer_surface_v1_set_size(output->layer_surface, 0, height); + zwlr_layer_surface_v1_set_margin(output->layer_surface, + output->bar->config->gaps.top, + output->bar->config->gaps.right, + output->bar->config->gaps.bottom, + output->bar->config->gaps.left); if (strcmp(output->bar->config->mode, "dock") == 0) { zwlr_layer_surface_v1_set_exclusive_zone(output->layer_surface, height); } -- cgit v1.2.3-54-g00ecf