module/river: rename the ‘per-output’ option to ‘all-monitors’

This also inverts its meaning.
This commit is contained in:
Daniel Eklöf 2021-08-25 10:47:40 +02:00
parent 621f0e18e6
commit 103c3102a9
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 13 additions and 13 deletions

View file

@ -19,7 +19,7 @@
(https://codeberg.org/dnkl/yambar/issues/77). (https://codeberg.org/dnkl/yambar/issues/77).
* bar: `layer: top|bottom`, allowing the layer which the bar is * bar: `layer: top|bottom`, allowing the layer which the bar is
rendered on to be changed. Wayland only - ignored on X11. 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 * `-d,--log-level=info|warning|error|none` command line option
(https://codeberg.org/dnkl/yambar/issues/84). (https://codeberg.org/dnkl/yambar/issues/84).
* river: support for the river-status protocol, version 2 (urgent * river: support for the river-status protocol, version 2 (urgent

View file

@ -63,12 +63,12 @@ once for all 32 river tags. This means you probably want to use a
: particle : particle
: yes : yes
: Template particle that will be instantiated once for all of the 32 river tags. : Template particle that will be instantiated once for all of the 32 river tags.
| per-output | all-monitors
: bool : bool
: no : no
: When set to false (the default), tags reflect the union of all : When set to false (the default), tags reflect river tags and seats
outputs. When set to true, tags reflect river tags and seats for for the monitor yambar is on only. When set to true, tags reflect
the output yambar is on only. the union of all monitors.
# EXAMPLES # EXAMPLES

View file

@ -49,7 +49,7 @@ struct private {
struct zriver_status_manager_v1 *status_manager; struct zriver_status_manager_v1 *status_manager;
struct particle *template; struct particle *template;
struct particle *title; struct particle *title;
bool per_output; bool all_monitors;
bool is_starting_up; bool is_starting_up;
tll(struct output) outputs; tll(struct output) outputs;
@ -90,7 +90,7 @@ content(struct module *mod)
tll_foreach(m->outputs, it) { tll_foreach(m->outputs, it) {
const struct output *output = &it->item; const struct output *output = &it->item;
if (m->per_output && if (!m->all_monitors &&
output_bar_is_on != NULL && output->name != NULL && output_bar_is_on != NULL && output->name != NULL &&
strcmp(output->name, output_bar_is_on) != 0) 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); 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 && (output_bar_is_on != NULL &&
seat->output != NULL && seat->output->name != NULL && seat->output != NULL && seat->output->name != NULL &&
strcmp(output_bar_is_on, seat->output->name) == 0)) strcmp(output_bar_is_on, seat->output->name) == 0))
@ -696,12 +696,12 @@ out:
} }
static struct module * 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)); struct private *m = calloc(1, sizeof(*m));
m->template = template; m->template = template;
m->title = title; m->title = title;
m->per_output = per_output; m->all_monitors = all_monitors;
m->is_starting_up = true; m->is_starting_up = true;
struct module *mod = module_common_new(); 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 *c = yml_get_value(node, "content");
const struct yml_node *title = yml_get_value(node, "title"); 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( return river_new(
conf_to_particle(c, inherited), conf_to_particle(c, inherited),
title != NULL ? conf_to_particle(title, inherited) : NULL, 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 static bool
@ -732,7 +732,7 @@ verify_conf(keychain_t *chain, const struct yml_node *node)
{ {
static const struct attr_info attrs[] = { static const struct attr_info attrs[] = {
{"title", false, &conf_verify_particle}, {"title", false, &conf_verify_particle},
{"per-output", false, &conf_verify_bool}, {"all-monitors", false, &conf_verify_bool},
MODULE_COMMON_ATTRS, MODULE_COMMON_ATTRS,
}; };