aboutsummaryrefslogtreecommitdiff
path: root/sway/ipc-server.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-02-27 16:18:50 -0500
committerDrew DeVault <sir@cmpwn.com>2016-02-27 16:18:50 -0500
commit3453910c3e887be900c69394b738e34d9d8ba095 (patch)
tree28e0d8d72557ac57a2f9aed5c94818c8ba20e97f /sway/ipc-server.c
parent5ff3fb1c0472d974f74c0329a10895cc76c83a55 (diff)
parent67bbcceba1433e41b5edfca32532b7d55a39a395 (diff)
Merge pull request #492 from mikkeloscar/swaybar-multi-output
Display single swaybar on multiple outputs
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r--sway/ipc-server.c11
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) {
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;
}