aboutsummaryrefslogtreecommitdiff
path: root/sway/main.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-08-03 15:08:38 -0400
committerGitHub <noreply@github.com>2018-08-03 15:08:38 -0400
commit38675eba7be471a2dacb5928f54d046297c23517 (patch)
tree7982d1f38fcb3620372c1c8461de1450063e5355 /sway/main.c
parent3e2bf7f3a550db995a38808e0abd53fefab96f80 (diff)
parent36fd84cc42ebb2933d24c2d3d4b84f3f32f065b0 (diff)
Merge pull request #2400 from RedSoxFan/swaynag-config-errors
Show swaynag on config errors
Diffstat (limited to 'sway/main.c')
-rw-r--r--sway/main.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sway/main.c b/sway/main.c
index 477ffa5a..c02caf42 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -22,6 +22,7 @@
#include "sway/debug.h"
#include "sway/desktop/transaction.h"
#include "sway/server.h"
+#include "sway/swaynag.h"
#include "sway/tree/layout.h"
#include "sway/ipc-server.h"
#include "ipc-client.h"
@@ -416,11 +417,12 @@ int main(int argc, char **argv) {
log_env();
if (validate) {
- bool valid = load_main_config(config_path, false);
+ bool valid = load_main_config(config_path, false, true);
return valid ? 0 : 1;
}
- if (!load_main_config(config_path, false)) {
+ setenv("WAYLAND_DISPLAY", server.socket, true);
+ if (!load_main_config(config_path, false, false)) {
sway_terminate(EXIT_FAILURE);
}
@@ -430,7 +432,6 @@ int main(int argc, char **argv) {
security_sanity_check();
- setenv("WAYLAND_DISPLAY", server.socket, true);
if (!terminate_request) {
if (!server_start_backend(&server)) {
sway_terminate(EXIT_FAILURE);
@@ -452,6 +453,10 @@ int main(int argc, char **argv) {
}
transaction_commit_dirty();
+ if (config->swaynag_config_errors.pid > 0) {
+ swaynag_show(&config->swaynag_config_errors);
+ }
+
if (!terminate_request) {
server_run(&server);
}