diff --git a/Makefile b/Makefile index d3862e5..c0efb4a 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ include config.mk # flags for compiling DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" -DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wshadow -Wunused-macros\ +DWLDEVCFLAGS = -g -pedantic -Werror -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wshadow -Wunused-macros\ -Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types -Wfloat-conversion # CFLAGS / LDFLAGS diff --git a/config.def.h b/config.def.h index c420677..3904f8d 100644 --- a/config.def.h +++ b/config.def.h @@ -16,15 +16,12 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca /* Autostart */ static const char *const autostart[] = { + "systemctl", "--user", "import-environment", "WAYLAND_DISPLAY", NULL, + "dbus-update-activation-environment", "--systemd", "WAYLAND_DISPLAY", NULL, "gammastep-indicator", NULL, "foot", NULL, "todoodoo", NULL, "firefox", NULL, - "somebar", NULL, - "someblocks", NULL, - "systemctl", "--user", "import-environment", "WAYLAND_DISPLAY", NULL, - "hash", "dbus-update-actifvation-environment", NULL, - "dbus-update-activation-environment", "--systemd", "WAYLAND_DISPLAY", NULL, NULL /* terminate */ }; diff --git a/dwl.c b/dwl.c index 5117b38..d865522 100644 --- a/dwl.c +++ b/dwl.c @@ -404,33 +404,36 @@ applybounds(Client *c, struct wlr_box *bbox) void autostartexec(void) { const char *const *p; + const char *rp; size_t i = 0; + size_t j; /* count entries */ for (p = autostart; *p; autostart_len++, p++) while (*++p); /* count runtime entries */ - for (p = autostart_runtime; *p; autostart_len++, p++) - while (*++p); + for (j = 0; autostart_runtime[j]; j++) + autostart_len++; + j = 0; + fflush(stdout); autostart_pids = calloc(autostart_len, sizeof(pid_t)); for (p = autostart; *p; i++, p++) { if ((autostart_pids[i] = fork()) == 0) { setsid(); - execvp(*p, (char *const *)p); - die("dwl: execvp %s:", *p); + execvp(*p, (char* const*)p); + die("dwl: execvp %s autostart failed:", *p); } /* skip arguments */ while (*++p); } - for (p = autostart_runtime; *p; i++, p++) { + + for (rp = autostart_runtime[0]; autostart_runtime[j]; j++, i++) { if ((autostart_pids[i] = fork()) == 0) { setsid(); - execvp(*p, (char *const *)p); - die("dwl: execvp %s:", *p); + execl(rp, rp, NULL); + die("dwl: execvp %s autostart runtime failed:", rp); } - /* skip arguments */ - while (*++p); } } @@ -2826,7 +2829,7 @@ main(int argc, char *argv[]) int c; char *path = calloc(8192, sizeof(char)); - int autostart_runtime_idx = 0; + size_t autostart_runtime_idx = 0; strcat(path, getenv("PATH")); while ((c = getopt(argc, argv, "e:p:s:hdv")) != -1) { @@ -2839,8 +2842,6 @@ main(int argc, char *argv[]) else if (c == 'e') { autostart_runtime[autostart_runtime_idx] = optarg; autostart_runtime_idx++; - autostart_runtime[autostart_runtime_idx] = NULL; - autostart_runtime_idx++; } else if (c == 'd') log_level = WLR_DEBUG;