diff --git a/docs/bindings/keys.md b/docs/bindings/keys.md index f1814ca7f..78e9adbec 100644 --- a/docs/bindings/keys.md +++ b/docs/bindings/keys.md @@ -182,7 +182,7 @@ It is formed by tag numbers `1`–`9`, optionally combined with `|`. | :--- | :--- | :--- | | `spawn` | `cmd` | Execute a command. | | `spawn_shell` | `cmd` | Execute shell command (supports pipes `\|`). | -| `spawn_on_empty` | `cmd, tagmask` | Open command on empty tag.Accepts a cmd string and [tagmask](/docs/bindings/keys#tag-mask-format) | +| `spawn_on_empty` | `cmd, tagmask[,synctag]` | Open command on empty tag.Accepts a cmd string and [tagmask](/docs/bindings/keys#tag-mask-format) | | `reload_config` | - | Hot-reload configuration. | | `load_config_file` | `file path` | Load configuration from the specified file. Empty path resets to default config location. | | `quit` | - | Exit mangowm. | diff --git a/src/config/parse_config.h b/src/config/parse_config.h index b9a7d52d8..03424989a 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -1377,6 +1377,7 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value, func = spawn_on_empty; (*arg).v = strdup(arg_value); (*arg).ui = parse_tag_mask(arg_value2); + (*arg).i = atoi(arg_value3); } else if (strcmp(func_name, "quit") == 0) { func = quit; } else if (strcmp(func_name, "create_virtual_output") == 0) { diff --git a/src/dispatch/bind_define.h b/src/dispatch/bind_define.h index 573313903..278bafd7b 100644 --- a/src/dispatch/bind_define.h +++ b/src/dispatch/bind_define.h @@ -1163,10 +1163,10 @@ void spawn_on_empty(const Arg *arg) { } } if (!is_empty) { - view(arg, true); + bind_to_view(arg); return; } else { - view(arg, true); + bind_to_view(arg); spawn_shell(arg); } return;