aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/commands/bind.c12
-rw-r--r--sway/sway.5.scd8
2 files changed, 14 insertions, 6 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,
161 binding->type = bindcode ? BINDING_KEYCODE : BINDING_KEYSYM; 161 binding->type = bindcode ? BINDING_KEYCODE : BINDING_KEYSYM;
162 162
163 bool exclude_titlebar = false; 163 bool exclude_titlebar = false;
164 bool warn = true;
164 165
165 // Handle --release and --locked 166 // Handle --release and --locked
166 while (argc > 0) { 167 while (argc > 0) {
@@ -178,6 +179,8 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
178 strlen("--input-device=")) == 0) { 179 strlen("--input-device=")) == 0) {
179 free(binding->input); 180 free(binding->input);
180 binding->input = strdup(argv[0] + strlen("--input-device=")); 181 binding->input = strdup(argv[0] + strlen("--input-device="));
182 } else if (strcmp("--no-warn", argv[0]) == 0) {
183 warn = false;
181 } else { 184 } else {
182 break; 185 break;
183 } 186 }
@@ -258,9 +261,12 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
258 wlr_log(WLR_INFO, "Overwriting binding '%s' for device '%s' " 261 wlr_log(WLR_INFO, "Overwriting binding '%s' for device '%s' "
259 "from `%s` to `%s`", argv[0], binding->input, 262 "from `%s` to `%s`", argv[0], binding->input,
260 binding->command, config_binding->command); 263 binding->command, config_binding->command);
261 config_add_swaynag_warning("Overwriting binding '%s' for device " 264 if (warn) {
262 "'%s' to `%s` from `%s`", argv[0], binding->input, 265 config_add_swaynag_warning("Overwriting binding"
263 binding->command, config_binding->command); 266 "'%s' for device '%s' to `%s` from `%s`",
267 argv[0], binding->input, binding->command,
268 config_binding->command);
269 }
264 free_sway_binding(config_binding); 270 free_sway_binding(config_binding);
265 mode_bindings->items[i] = binding; 271 mode_bindings->items[i] = binding;
266 overwritten = true; 272 overwritten = true;
diff --git a/sway/sway.5.scd b/sway/sway.5.scd
index 651c2302..f90c9c80 100644
--- a/sway/sway.5.scd
+++ b/sway/sway.5.scd
@@ -277,14 +277,16 @@ runtime.
277 277
278 for\_window <criteria> move container to output <output> 278 for\_window <criteria> move container to output <output>
279 279
280*bindsym* [--release|--locked] [--input-device=<device>] <key combo> <command> 280*bindsym* [--release|--locked] [--input-device=<device>] [--no-warn] <key combo> <command>
281 Binds _key combo_ to execute the sway command _command_ when pressed. You 281 Binds _key combo_ to execute the sway command _command_ when pressed. You
282 may use XKB key names here (*xev*(1) is a good tool for discovering these). 282 may use XKB key names here (*xev*(1) is a good tool for discovering these).
283 With the flag _--release_, the command is executed when the key combo is 283 With the flag _--release_, the command is executed when the key combo is
284 released. Unless the flag _--locked_ is set, the command will not be run 284 released. Unless the flag _--locked_ is set, the command will not be run
285 when a screen locking program is active. If _input-device_ is given, the 285 when a screen locking program is active. If _input-device_ is given, the
286 binding will only be executed for that input device and will be executed 286 binding will only be executed for that input device and will be executed
287 instead of any binding that is generic to all devices. 287 instead of any binding that is generic to all devices. By default, if you
288 overwrite a binding, swaynag will give you a warning. To silence this, use
289 the _--no-warn_ flag.
288 290
289 Example: 291 Example:
290``` 292```
@@ -292,7 +294,7 @@ runtime.
292 bindsym Mod1+Shift+f exec firefox 294 bindsym Mod1+Shift+f exec firefox
293``` 295```
294 296
295 *bindcode* [--release|--locked] [--input-device=<device>] <code> <command> 297 *bindcode* [--release|--locked] [--input-device=<device>] [--no-warn] <code> <command>
296 is also available for binding with key codes instead of key names. 298 is also available for binding with key codes instead of key names.
297 299
298*client.<class>* <border> <background> <text> <indicator> <child\_border> 300*client.<class>* <border> <background> <text> <indicator> <child\_border>