diff options
author | emersion <contact@emersion.fr> | 2018-05-16 09:10:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-16 09:10:28 +0100 |
commit | 2df8f266cd758221ad6e0fa182feb3b4c6d4142c (patch) | |
tree | 770f7f47574311c5ee91f8217defb4e6ba0a41a4 /sway/main.c | |
parent | c7c2e5357cee8b3a5d1ce7d2dcd000d51b417fd8 (diff) | |
parent | 89ae1792b58a1a29afce7e00da06593187297459 (diff) |
Merge pull request #1991 from martinetd/ready_nox
sway: run commands without waiting for Xwayland
Diffstat (limited to 'sway/main.c')
-rw-r--r-- | sway/main.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sway/main.c b/sway/main.c index efb674b6..e03b8e3a 100644 --- a/sway/main.c +++ b/sway/main.c @@ -16,6 +16,7 @@ #include <sys/prctl.h> #endif #include <wlr/util/log.h> +#include "sway/commands.h" #include "sway/config.h" #include "sway/debug.h" #include "sway/server.h" @@ -410,9 +411,18 @@ int main(int argc, char **argv) { security_sanity_check(); - // TODO: wait for server to be ready - // TODO: consume config->cmd_queue config->active = true; + // Execute commands until there are none left + while (config->cmd_queue->length) { + char *line = config->cmd_queue->items[0]; + struct cmd_results *res = execute_command(line, NULL); + if (res->status != CMD_SUCCESS) { + wlr_log(L_ERROR, "Error on line '%s': %s", line, res->error); + } + free_cmd_results(res); + free(line); + list_del(config->cmd_queue, 0); + } if (!terminate_request) { server_run(&server); |