Add layer option

Only applies to Wayland and the default is still bottom.
This commit is contained in:
Nulo 2021-08-25 13:20:33 -03:00 committed by Daniel Eklöf
parent 7e7c011126
commit eb94c8cceb
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
8 changed files with 35 additions and 1 deletions

View file

@ -204,6 +204,7 @@ conf_to_bar(const struct yml_node *bar, enum bar_backend backend)
struct bar_config conf = {
.backend = backend,
.layer = BAR_LAYER_BOTTOM,
};
/*
@ -228,6 +229,18 @@ conf_to_bar(const struct yml_node *bar, enum bar_backend backend)
if (monitor != NULL)
conf.monitor = yml_value_as_string(monitor);
const struct yml_node *layer = yml_get_value(bar, "layer");
if (layer != NULL) {
const char *tmp = yml_value_as_string(layer);
if (strcmp(tmp, "top") == 0)
conf.layer = BAR_LAYER_TOP;
else if (strcmp(tmp, "bottom") == 0)
conf.layer = BAR_LAYER_BOTTOM;
else
assert(false);
}
const struct yml_node *spacing = yml_get_value(bar, "spacing");
if (spacing != NULL)
conf.left_spacing = conf.right_spacing = yml_value_as_int(spacing);