diff options
author | Brian Ashworth <[email protected]> | 2018-10-08 11:40:13 -0400 |
---|---|---|
committer | Brian Ashworth <[email protected]> | 2018-10-09 08:12:46 -0400 |
commit | 1c969e86f50065985ddf35b7fef62c14aa7688a5 (patch) | |
tree | 1d44b026ffb8cd67595b695ac92275ba320ee4d9 /sway/ipc-json.c | |
parent | e143c9613d350b74e02c5ac3c9a055ab26fc9588 (diff) |
Implement bar bindsym
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r-- | sway/ipc-json.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index f02f370b..54d611f2 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -623,6 +623,22 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) { json_object_object_add(json, "colors", colors); + if (bar->bindings->length > 0) { + json_object *bindings = json_object_new_array(); + for (int i = 0; i < bar->bindings->length; ++i) { + struct bar_binding *binding = bar->bindings->items[i]; + json_object *bind = json_object_new_object(); + json_object_object_add(bind, "input_code", + json_object_new_int(binding->button)); + json_object_object_add(bind, "command", + json_object_new_string(binding->command)); + json_object_object_add(bind, "release", + json_object_new_boolean(binding->release)); + json_object_array_add(bindings, bind); + } + json_object_object_add(json, "bindings", bindings); + } + // Add outputs if defined if (bar->outputs && bar->outputs->length > 0) { json_object *outputs = json_object_new_array(); |