mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-06-16 00:05:40 +02:00
Add layer option
Only applies to Wayland and the default is still bottom.
This commit is contained in:
parent
7e7c011126
commit
eb94c8cceb
8 changed files with 35 additions and 1 deletions
13
config.c
13
config.c
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue