diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-01-07 16:38:33 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-01-07 16:38:33 -0500 |
commit | 320c2915b0aeb4bbecb753bf00091e24905c5652 (patch) | |
tree | a854f1068b7360952835b38bc38a1138bf1de7f0 /sway/commands.c | |
parent | 8f5de70c93b2afaab0dd7d384c58ff3d3007193c (diff) | |
parent | 55f63935ab9319da8e145b49edc1a7ae3e6782c6 (diff) |
Merge pull request #439 from mikkeloscar/bindsym-release
Implement bindsym --release
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) { return cmd_results_new(CMD_FAILURE, "bindsym", "Can only be used in config file."); } + struct sway_binding *binding = malloc(sizeof(struct sway_binding)); binding->keys = create_list(); binding->modifiers = 0; + binding->release = false; + + // Handle --release + if (strcmp("--release", argv[0]) == 0) { + if (argc >= 3) { + binding->release = true; + argv++; + argc--; + } else { + return cmd_results_new(CMD_FAILURE, "bindsym", + "Invalid bindsym command" + "(expected more than 2 arguments, got %d)", argc); + } + } + binding->command = join_args(argv + 1, argc - 1); list_t *split = split_string(argv[0], "+"); |