aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-10-08 11:40:13 -0400
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-10-09 08:12:46 -0400
commit1c969e86f50065985ddf35b7fef62c14aa7688a5 (patch)
tree1d44b026ffb8cd67595b695ac92275ba320ee4d9 /sway/ipc-json.c
parentMerge pull request #2804 from Emantor/swaynag-double-free (diff)
downloadsway-1c969e86f50065985ddf35b7fef62c14aa7688a5.tar.gz
sway-1c969e86f50065985ddf35b7fef62c14aa7688a5.tar.zst
sway-1c969e86f50065985ddf35b7fef62c14aa7688a5.zip
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) {
623 623
624 json_object_object_add(json, "colors", colors); 624 json_object_object_add(json, "colors", colors);
625 625
626 if (bar->bindings->length > 0) {
627 json_object *bindings = json_object_new_array();
628 for (int i = 0; i < bar->bindings->length; ++i) {
629 struct bar_binding *binding = bar->bindings->items[i];
630 json_object *bind = json_object_new_object();
631 json_object_object_add(bind, "input_code",
632 json_object_new_int(binding->button));
633 json_object_object_add(bind, "command",
634 json_object_new_string(binding->command));
635 json_object_object_add(bind, "release",
636 json_object_new_boolean(binding->release));
637 json_object_array_add(bindings, bind);
638 }
639 json_object_object_add(json, "bindings", bindings);
640 }
641
626 // Add outputs if defined 642 // Add outputs if defined
627 if (bar->outputs && bar->outputs->length > 0) { 643 if (bar->outputs && bar->outputs->length > 0) {
628 json_object *outputs = json_object_new_array(); 644 json_object *outputs = json_object_new_array();