From 103c3102a99477a50efc701f6babdeb9ee20c602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 25 Aug 2021 10:47:40 +0200 Subject: [PATCH] =?UTF-8?q?module/river:=20rename=20the=20=E2=80=98per-out?= =?UTF-8?q?put=E2=80=99=20option=20to=20=E2=80=98all-monitors=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This also inverts its meaning. --- CHANGELOG.md | 2 +- doc/yambar-modules-river.5.scd | 8 ++++---- modules/river.c | 16 ++++++++-------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6248817..08a7ddb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ (https://codeberg.org/dnkl/yambar/issues/77). * bar: `layer: top|bottom`, allowing the layer which the bar is rendered on to be changed. Wayland only - ignored on X11. -* river: `per-output: false|true`. +* river: `all-monitors: false|true`. * `-d,--log-level=info|warning|error|none` command line option (https://codeberg.org/dnkl/yambar/issues/84). * river: support for the river-status protocol, version 2 (‘urgent’ diff --git a/doc/yambar-modules-river.5.scd b/doc/yambar-modules-river.5.scd index c9327d5..96be605 100644 --- a/doc/yambar-modules-river.5.scd +++ b/doc/yambar-modules-river.5.scd @@ -63,12 +63,12 @@ once for all 32 river tags. This means you probably want to use a : particle : yes : Template particle that will be instantiated once for all of the 32 river tags. -| per-output +| all-monitors : bool : no -: When set to false (the default), tags reflect the union of all - outputs. When set to true, tags reflect river tags and seats for - the output yambar is on only. +: When set to false (the default), tags reflect river tags and seats + for the monitor yambar is on only. When set to true, tags reflect + the union of all monitors. # EXAMPLES diff --git a/modules/river.c b/modules/river.c index ebc1e35..f9854f2 100644 --- a/modules/river.c +++ b/modules/river.c @@ -49,7 +49,7 @@ struct private { struct zriver_status_manager_v1 *status_manager; struct particle *template; struct particle *title; - bool per_output; + bool all_monitors; bool is_starting_up; tll(struct output) outputs; @@ -90,7 +90,7 @@ content(struct module *mod) tll_foreach(m->outputs, it) { const struct output *output = &it->item; - if (m->per_output && + if (!m->all_monitors && output_bar_is_on != NULL && output->name != NULL && strcmp(output->name, output_bar_is_on) != 0) { @@ -420,7 +420,7 @@ focused_view(void *data, struct zriver_seat_status_v1 *zriver_seat_status_v1, const char *output_bar_is_on = mod->bar->output_name(mod->bar); - if (!seat->m->per_output || + if (seat->m->all_monitors || (output_bar_is_on != NULL && seat->output != NULL && seat->output->name != NULL && strcmp(output_bar_is_on, seat->output->name) == 0)) @@ -696,12 +696,12 @@ out: } static struct module * -river_new(struct particle *template, struct particle *title, bool per_output) +river_new(struct particle *template, struct particle *title, bool all_monitors) { struct private *m = calloc(1, sizeof(*m)); m->template = template; m->title = title; - m->per_output = per_output; + m->all_monitors = all_monitors; m->is_starting_up = true; struct module *mod = module_common_new(); @@ -719,12 +719,12 @@ from_conf(const struct yml_node *node, struct conf_inherit inherited) { const struct yml_node *c = yml_get_value(node, "content"); const struct yml_node *title = yml_get_value(node, "title"); - const struct yml_node *per_output = yml_get_value(node, "per-output"); + const struct yml_node *all_monitors = yml_get_value(node, "all-monitors"); return river_new( conf_to_particle(c, inherited), title != NULL ? conf_to_particle(title, inherited) : NULL, - per_output != NULL ? yml_value_as_bool(per_output) : false); + all_monitors != NULL ? yml_value_as_bool(all_monitors) : false); } static bool @@ -732,7 +732,7 @@ verify_conf(keychain_t *chain, const struct yml_node *node) { static const struct attr_info attrs[] = { {"title", false, &conf_verify_particle}, - {"per-output", false, &conf_verify_bool}, + {"all-monitors", false, &conf_verify_bool}, MODULE_COMMON_ATTRS, };