diff options
Diffstat (limited to 'sway/commands/input/xkb_rules.c')
-rw-r--r-- | sway/commands/input/xkb_rules.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sway/commands/input/xkb_rules.c b/sway/commands/input/xkb_rules.c index 560f088e..257c3288 100644 --- a/sway/commands/input/xkb_rules.c +++ b/sway/commands/input/xkb_rules.c | |||
@@ -9,18 +9,15 @@ struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) { | |||
9 | if ((error = checkarg(argc, "xkb_rules", EXPECTED_EQUAL_TO, 1))) { | 9 | if ((error = checkarg(argc, "xkb_rules", EXPECTED_EQUAL_TO, 1))) { |
10 | return error; | 10 | return error; |
11 | } | 11 | } |
12 | struct input_config *current_input_config = | 12 | struct input_config *ic = config->handler_context.input_config; |
13 | config->handler_context.input_config; | 13 | if (!ic) { |
14 | if (!current_input_config) { | 14 | return cmd_results_new(CMD_FAILURE, "xkb_rules", |
15 | return cmd_results_new(CMD_FAILURE, "xkb_rules", "No input device defined."); | 15 | "No input device defined."); |
16 | } | 16 | } |
17 | struct input_config *new_config = | ||
18 | new_input_config(current_input_config->identifier); | ||
19 | 17 | ||
20 | new_config->xkb_rules = strdup(argv[0]); | 18 | ic->xkb_rules = strdup(argv[0]); |
21 | 19 | ||
22 | wlr_log(WLR_DEBUG, "apply-xkb_rules for device: %s rules: %s", | 20 | wlr_log(WLR_DEBUG, "set-xkb_rules for config: %s rules: %s", |
23 | current_input_config->identifier, new_config->xkb_rules); | 21 | ic->identifier, ic->xkb_rules); |
24 | apply_input_config(new_config); | ||
25 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 22 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
26 | } | 23 | } |