diff options
author | Harish Krupo <harishkrupo@gmail.com> | 2018-11-12 14:33:16 +0530 |
---|---|---|
committer | Harish Krupo <harishkrupo@gmail.com> | 2018-11-12 22:00:22 +0530 |
commit | d8ad429e3974690ed7b48e5ad1d5af6dc7f2aebe (patch) | |
tree | bf43028f14e68cd1dcd1b3c4fcec6506674d4376 /swaymsg/main.c | |
parent | ee6b0ce24ae74cfae5d41985cacdff6065c8f534 (diff) |
IPC: Send keyboard layout info in IPC_GET_INPUTS
Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
Diffstat (limited to 'swaymsg/main.c')
-rw-r--r-- | swaymsg/main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c index 663518f6..243b5fdc 100644 --- a/swaymsg/main.c +++ b/swaymsg/main.c @@ -111,7 +111,7 @@ static const char *pretty_type_name(const char *name) { } static void pretty_print_input(json_object *i) { - json_object *id, *name, *type, *product, *vendor; + json_object *id, *name, *type, *product, *vendor, *kbdlayout; json_object_object_get_ex(i, "identifier", &id); json_object_object_get_ex(i, "name", &name); json_object_object_get_ex(i, "type", &type); @@ -123,7 +123,7 @@ static void pretty_print_input(json_object *i) { " Type: %s\n" " Identifier: %s\n" " Product ID: %d\n" - " Vendor ID: %d\n\n"; + " Vendor ID: %d\n"; printf(fmt, json_object_get_string(name), @@ -131,6 +131,13 @@ static void pretty_print_input(json_object *i) { json_object_get_string(id), json_object_get_int(product), json_object_get_int(vendor)); + + if (json_object_object_get_ex(i, "xkb_active_layout_name", &kbdlayout)) { + printf(" Active Keyboard Layout: %s\n", + json_object_get_string(kbdlayout)); + } + + printf("\n"); } static void pretty_print_seat(json_object *i) { |