diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c index 4e5bc712..6a316596 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -163,9 +163,25 @@ static struct cmd_results *cmd_bindsym(int argc, char **argv) { | |||
163 | return cmd_results_new(CMD_FAILURE, "bindsym", "Can only be used in config file."); | 163 | return cmd_results_new(CMD_FAILURE, "bindsym", "Can only be used in config file."); |
164 | } | 164 | } |
165 | 165 | ||
166 | |||
166 | struct sway_binding *binding = malloc(sizeof(struct sway_binding)); | 167 | struct sway_binding *binding = malloc(sizeof(struct sway_binding)); |
167 | binding->keys = create_list(); | 168 | binding->keys = create_list(); |
168 | binding->modifiers = 0; | 169 | binding->modifiers = 0; |
170 | binding->release = false; | ||
171 | |||
172 | // Handle --release | ||
173 | if (strcmp("--release", argv[0]) == 0) { | ||
174 | if (argc >= 3) { | ||
175 | binding->release = true; | ||
176 | argv++; | ||
177 | argc--; | ||
178 | } else { | ||
179 | return cmd_results_new(CMD_FAILURE, "bindsym", | ||
180 | "Invalid bindsym command" | ||
181 | "(expected more than 2 arguments, got %d)", argc); | ||
182 | } | ||
183 | } | ||
184 | |||
169 | binding->command = join_args(argv + 1, argc - 1); | 185 | binding->command = join_args(argv + 1, argc - 1); |
170 | 186 | ||
171 | list_t *split = split_string(argv[0], "+"); | 187 | list_t *split = split_string(argv[0], "+"); |