diff options
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/sway/config.c b/sway/config.c index 2d7e241d..9cc5addd 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -218,18 +218,22 @@ bool read_config(FILE *file, bool is_active) { | |||
218 | // Any command which would require wlc to be initialized | 218 | // Any command which would require wlc to be initialized |
219 | // should be queued for later execution | 219 | // should be queued for later execution |
220 | list_t *args = split_string(line, " "); | 220 | list_t *args = split_string(line, " "); |
221 | if (!is_active && ( | 221 | struct cmd_handler *handler; |
222 | strcmp("exec", args->items[0]) == 0 || | 222 | if ((handler = find_handler(args->items[0]))) { |
223 | strcmp("exec_always", args->items[0]) == 0 )) { | 223 | if (handler->config_type > 0) { |
224 | sway_log(L_DEBUG, "Deferring command %s", line); | 224 | sway_log(L_ERROR, "Invalid command during config ``%s''", line); |
225 | 225 | } else if (handler->config_type < 0 && !is_active) { | |
226 | char *cmd = malloc(strlen(line) + 1); | 226 | sway_log(L_DEBUG, "Deferring command ``%s''", line); |
227 | strcpy(cmd, line); | 227 | char *cmd = malloc(strlen(line) + 1); |
228 | list_add(temp_config->cmd_queue, cmd); | 228 | strcpy(cmd, line); |
229 | } else if (!temp_depth && !handle_command(temp_config, line)) { | 229 | list_add(temp_config->cmd_queue, cmd); |
230 | sway_log(L_DEBUG, "Config load failed for line %s", line); | 230 | } else if (!temp_depth && !handle_command(temp_config, line)) { |
231 | success = false; | 231 | sway_log(L_DEBUG, "Config load failed for line ``%s''", line); |
232 | temp_config->failed = true; | 232 | success = false; |
233 | temp_config->failed = true; | ||
234 | } | ||
235 | } else { | ||
236 | sway_log(L_ERROR, "Invalid command %s",args->items[0]); | ||
233 | } | 237 | } |
234 | free_flat_list(args); | 238 | free_flat_list(args); |
235 | 239 | ||