diff options
author | 2018-11-12 21:26:00 +0100 | |
---|---|---|
committer | 2018-11-12 21:26:00 +0100 | |
commit | 3b8d4a9212c335211001e96a0b0fbcb8049d0557 (patch) | |
tree | c4ba1704c7d1bfe6f1006eda6b788dee14e071d9 /swaymsg/main.c | |
parent | Merge pull request #2979 from RedSoxFan/config-var-repl (diff) | |
parent | IPC: Send keyboard layout info in IPC_GET_INPUTS (diff) | |
download | sway-3b8d4a9212c335211001e96a0b0fbcb8049d0557.tar.gz sway-3b8d4a9212c335211001e96a0b0fbcb8049d0557.tar.zst sway-3b8d4a9212c335211001e96a0b0fbcb8049d0557.zip |
Merge pull request #3116 from harishkrupo/master
IPC: Send keyboard layout info in IPC_GET_INPUTS
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) { | |||
111 | } | 111 | } |
112 | 112 | ||
113 | static void pretty_print_input(json_object *i) { | 113 | static void pretty_print_input(json_object *i) { |
114 | json_object *id, *name, *type, *product, *vendor; | 114 | json_object *id, *name, *type, *product, *vendor, *kbdlayout; |
115 | json_object_object_get_ex(i, "identifier", &id); | 115 | json_object_object_get_ex(i, "identifier", &id); |
116 | json_object_object_get_ex(i, "name", &name); | 116 | json_object_object_get_ex(i, "name", &name); |
117 | json_object_object_get_ex(i, "type", &type); | 117 | json_object_object_get_ex(i, "type", &type); |
@@ -123,7 +123,7 @@ static void pretty_print_input(json_object *i) { | |||
123 | " Type: %s\n" | 123 | " Type: %s\n" |
124 | " Identifier: %s\n" | 124 | " Identifier: %s\n" |
125 | " Product ID: %d\n" | 125 | " Product ID: %d\n" |
126 | " Vendor ID: %d\n\n"; | 126 | " Vendor ID: %d\n"; |
127 | 127 | ||
128 | 128 | ||
129 | printf(fmt, json_object_get_string(name), | 129 | printf(fmt, json_object_get_string(name), |
@@ -131,6 +131,13 @@ static void pretty_print_input(json_object *i) { | |||
131 | json_object_get_string(id), | 131 | json_object_get_string(id), |
132 | json_object_get_int(product), | 132 | json_object_get_int(product), |
133 | json_object_get_int(vendor)); | 133 | json_object_get_int(vendor)); |
134 | |||
135 | if (json_object_object_get_ex(i, "xkb_active_layout_name", &kbdlayout)) { | ||
136 | printf(" Active Keyboard Layout: %s\n", | ||
137 | json_object_get_string(kbdlayout)); | ||
138 | } | ||
139 | |||
140 | printf("\n"); | ||
134 | } | 141 | } |
135 | 142 | ||
136 | static void pretty_print_seat(json_object *i) { | 143 | static void pretty_print_seat(json_object *i) { |