diff options
author | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-02-23 14:40:46 +0100 |
---|---|---|
committer | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-02-27 22:12:35 +0100 |
commit | 212c6a18a2003f61bbbd7b6f4a881610e31b0c53 (patch) | |
tree | f49922ef80844933eb4983ff1f3de7b874e5461b /sway | |
parent | Make sway spawn only one bar per bar config (diff) | |
download | sway-212c6a18a2003f61bbbd7b6f4a881610e31b0c53.tar.gz sway-212c6a18a2003f61bbbd7b6f4a881610e31b0c53.tar.zst sway-212c6a18a2003f61bbbd7b6f4a881610e31b0c53.zip |
Add outputs to bar_config ipc response
Diffstat (limited to 'sway')
-rw-r--r-- | sway/ipc-server.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index a63026c6..9ea034d1 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c | |||
@@ -628,6 +628,17 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) { | |||
628 | 628 | ||
629 | json_object_object_add(json, "colors", colors); | 629 | json_object_object_add(json, "colors", colors); |
630 | 630 | ||
631 | // Add outputs if defined | ||
632 | if (bar->outputs && bar->outputs->length > 0) { | ||
633 | json_object *outputs = json_object_new_array(); | ||
634 | int i; | ||
635 | for (i = 0; i < bar->outputs->length; ++i) { | ||
636 | const char *name = bar->outputs->items[i]; | ||
637 | json_object_array_add(outputs, json_object_new_string(name)); | ||
638 | } | ||
639 | json_object_object_add(json, "outputs", outputs); | ||
640 | } | ||
641 | |||
631 | return json; | 642 | return json; |
632 | } | 643 | } |
633 | 644 | ||