diff --git a/sway/commands.c b/sway/commands.c index 28e9d8d20..210d2aaa2 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -413,6 +413,8 @@ struct cmd_results *config_command(char *exec, char **new_block) { && handler->handle != cmd_bindgesture && handler->handle != cmd_set && handler->handle != cmd_for_window + && handler->handle != cmd_output + && handler->handle != cmd_input && (*argv[i] == '\"' || *argv[i] == '\'')) { strip_quotes(argv[i]); } diff --git a/sway/commands/input.c b/sway/commands/input.c index 3075b5f46..b68d9e258 100644 --- a/sway/commands/input.c +++ b/sway/commands/input.c @@ -53,6 +53,13 @@ struct cmd_results *cmd_input(int argc, char **argv) { return error; } + // Commands from config_command() & execute_command() don't handle quotes the same way + for (int i = 0; i < argc; ++i) { + if (*argv[i] == '\"' || *argv[i] == '\'') { + strip_quotes(argv[i]); + } + } + sway_log(SWAY_DEBUG, "entering input block: %s", argv[0]); config->handler_context.input_config = new_input_config(argv[0]); diff --git a/sway/commands/output.c b/sway/commands/output.c index df32c6731..44bde3712 100644 --- a/sway/commands/output.c +++ b/sway/commands/output.c @@ -2,6 +2,7 @@ #include "sway/commands.h" #include "sway/config.h" #include "sway/output.h" +#include "stringop.h" #include "list.h" #include "log.h" @@ -43,6 +44,13 @@ struct cmd_results *cmd_output(int argc, char **argv) { "Refusing to configure the no op output"); } + // Commands from config_command() & execute_command() don't handle quotes the same way + for (int i = 0; i < argc; ++i) { + if (*argv[i] == '\"' || *argv[i] == '\'') { + strip_quotes(argv[i]); + } + } + struct output_config *output = NULL; if (strcmp(argv[0], "-") == 0 || strcmp(argv[0], "--") == 0) { if (config->reading) { diff --git a/sway/config/output.c b/sway/config/output.c index 3b524433c..c92be532b 100644 --- a/sway/config/output.c +++ b/sway/config/output.c @@ -733,7 +733,7 @@ void apply_output_config_to_outputs(struct output_config *oc) { wl_list_for_each_safe(sway_output, tmp, &root->all_outputs, link) { char *name = sway_output->wlr_output->name; output_get_identifier(id, sizeof(id), sway_output); - if (wildcard || !strcmp(name, oc->name) || !strcmp(id, oc->name)) { + if (wildcard || !output_name_cmp(oc, name) || !output_name_cmp(oc, id)) { struct output_config *current = get_output_config(id, sway_output); if (!current) { // No stored output config matched, apply oc directly