aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
authorBrian Ashworth <RedSoxFan@users.noreply.github.com>2018-12-02 22:41:22 -0500
committerGitHub <noreply@github.com>2018-12-02 22:41:22 -0500
commit6788910fd79b6bf28da473cab92c370e450f7cb3 (patch)
tree277085cbe90c8293b07d40b5f185047aed841213 /sway/commands
parentbf11a778840188e8f78a8637d70d3ade8df1380b (diff)
parent1a1a2d96cb27f70d072765259cddb29a6dd968a0 (diff)
Merge pull request #3239 from ForTheReallys/bindsym-no-warn
Add option to bindsym/bindcode to suppress warning on override
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/bind.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index 9112815f..c8b634b9 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -161,6 +161,7 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
binding->type = bindcode ? BINDING_KEYCODE : BINDING_KEYSYM;
bool exclude_titlebar = false;
+ bool warn = true;
// Handle --release and --locked
while (argc > 0) {
@@ -178,6 +179,8 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
strlen("--input-device=")) == 0) {
free(binding->input);
binding->input = strdup(argv[0] + strlen("--input-device="));
+ } else if (strcmp("--no-warn", argv[0]) == 0) {
+ warn = false;
} else {
break;
}
@@ -258,9 +261,12 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
wlr_log(WLR_INFO, "Overwriting binding '%s' for device '%s' "
"from `%s` to `%s`", argv[0], binding->input,
binding->command, config_binding->command);
- config_add_swaynag_warning("Overwriting binding '%s' for device "
- "'%s' to `%s` from `%s`", argv[0], binding->input,
- binding->command, config_binding->command);
+ if (warn) {
+ config_add_swaynag_warning("Overwriting binding"
+ "'%s' for device '%s' to `%s` from `%s`",
+ argv[0], binding->input, binding->command,
+ config_binding->command);
+ }
free_sway_binding(config_binding);
mode_bindings->items[i] = binding;
overwritten = true;