aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/input.c
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2019-06-09 21:17:28 +0300
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-06-09 15:20:14 -0400
commit2bccb387d81298ffd3b88a193deb3e32c0b6c494 (patch)
treeeda04f72b85e4b3251fc18336b925c67a9678b7c /sway/commands/input.c
parentipc: add xkb_layout_names and xkb_active_layout_index (diff)
downloadsway-2bccb387d81298ffd3b88a193deb3e32c0b6c494.tar.gz
sway-2bccb387d81298ffd3b88a193deb3e32c0b6c494.tar.zst
sway-2bccb387d81298ffd3b88a193deb3e32c0b6c494.zip
Add a new xkb_switch_layout command
This allows users to programatically change the active layout.
Diffstat (limited to 'sway/commands/input.c')
-rw-r--r--sway/commands/input.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sway/commands/input.c b/sway/commands/input.c
index d95c4baf..08af3cb2 100644
--- a/sway/commands/input.c
+++ b/sway/commands/input.c
@@ -31,6 +31,7 @@ static struct cmd_handler input_handlers[] = {
31 { "xkb_model", input_cmd_xkb_model }, 31 { "xkb_model", input_cmd_xkb_model },
32 { "xkb_options", input_cmd_xkb_options }, 32 { "xkb_options", input_cmd_xkb_options },
33 { "xkb_rules", input_cmd_xkb_rules }, 33 { "xkb_rules", input_cmd_xkb_rules },
34 { "xkb_switch_layout", input_cmd_xkb_switch_layout },
34 { "xkb_variant", input_cmd_xkb_variant }, 35 { "xkb_variant", input_cmd_xkb_variant },
35}; 36};
36 37
@@ -86,7 +87,8 @@ struct cmd_results *cmd_input(int argc, char **argv) {
86 input_handlers, sizeof(input_handlers)); 87 input_handlers, sizeof(input_handlers));
87 } 88 }
88 89
89 if (!res || res->status == CMD_SUCCESS) { 90 if ((!res || res->status == CMD_SUCCESS) &&
91 strcmp(argv[1], "xkb_switch_layout") != 0) {
90 char *error = NULL; 92 char *error = NULL;
91 struct input_config *ic = 93 struct input_config *ic =
92 store_input_config(config->handler_context.input_config, &error); 94 store_input_config(config->handler_context.input_config, &error);