mirror of
https://github.com/swaywm/sway.git
synced 2025-01-27 13:28:13 +01:00
Add outputs to bar_config ipc response
This commit is contained in:
parent
bad4e22f3b
commit
212c6a18a2
1 changed files with 11 additions and 0 deletions
|
@ -628,6 +628,17 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) {
|
||||||
|
|
||||||
json_object_object_add(json, "colors", colors);
|
json_object_object_add(json, "colors", colors);
|
||||||
|
|
||||||
|
// Add outputs if defined
|
||||||
|
if (bar->outputs && bar->outputs->length > 0) {
|
||||||
|
json_object *outputs = json_object_new_array();
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < bar->outputs->length; ++i) {
|
||||||
|
const char *name = bar->outputs->items[i];
|
||||||
|
json_object_array_add(outputs, json_object_new_string(name));
|
||||||
|
}
|
||||||
|
json_object_object_add(json, "outputs", outputs);
|
||||||
|
}
|
||||||
|
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue