diff options
author | Simon Ser <[email protected]> | 2019-06-09 21:17:28 +0300 |
---|---|---|
committer | Drew DeVault <[email protected]> | 2019-06-09 15:20:14 -0400 |
commit | 2bccb387d81298ffd3b88a193deb3e32c0b6c494 (patch) | |
tree | eda04f72b85e4b3251fc18336b925c67a9678b7c /sway/commands/input.c | |
parent | 84e4061bf40ab8749fb467e5662ea495d98036ab (diff) |
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.c | 4 |
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[] = { { "xkb_model", input_cmd_xkb_model }, { "xkb_options", input_cmd_xkb_options }, { "xkb_rules", input_cmd_xkb_rules }, + { "xkb_switch_layout", input_cmd_xkb_switch_layout }, { "xkb_variant", input_cmd_xkb_variant }, }; @@ -86,7 +87,8 @@ struct cmd_results *cmd_input(int argc, char **argv) { input_handlers, sizeof(input_handlers)); } - if (!res || res->status == CMD_SUCCESS) { + if ((!res || res->status == CMD_SUCCESS) && + strcmp(argv[1], "xkb_switch_layout") != 0) { char *error = NULL; struct input_config *ic = store_input_config(config->handler_context.input_config, &error); |