summaryrefslogtreecommitdiff
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2018-10-10 17:07:02 +0200
committerGitHub <[email protected]>2018-10-10 17:07:02 +0200
commit0a36d14d7a694a88580da1d9b83837afe608a2eb (patch)
treee21f0b633212c6b8084348f08fc68cec2efece8b /sway/ipc-json.c
parent782ed19bc30378126f44272c1e46f2a05a9b2db1 (diff)
parentcd6917d4a821fe904a2c242dff673967aa3ad4b2 (diff)
Merge pull request #2798 from RedSoxFan/bar-bindsym
Implement bar bindsym
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r--sway/ipc-json.c16
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();