diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | README.org | 1 | ||||
-rw-r--r-- | config.h | 6 | ||||
-rw-r--r-- | dwm.c | 58 |
5 files changed, 2 insertions, 65 deletions
@@ -127,5 +127,6 @@ flycheck_*.el *.def.h *.rej *.orig +.ccls* dwm compile_flags.txt @@ -55,7 +55,6 @@ List of patches in use: - alwayscenter - alwaysfullscreen - attachasideandbelow - - cool-autostart - fibonacci - focusonclick - nmaster @@ -52,7 +52,6 @@ List of patches in use: - /alwayscenter/ - /alwaysfullscreen/ - /attachasideandbelow/ -- /cool-autostart/ - /fibonacci/ - /focusonclick/ - /nmaster/ @@ -19,12 +19,6 @@ static const char *colors[][3] = { [SchemeSel] = { col_gray4, col_cyan, col_cyan }, }; -static const char *const autostart[] = { - "/home/jozan/.config/dwm/dwmrc", NULL, - "/usr/local/bin/notify-send", "-u", "normal", "Welcome", "\uf30c Welcome back, partner!", NULL, - NULL /* terminate */ -}; - /* tagging */ static const char *tags[] = { "0", "1", "2", "3", "4", "5", "6", "7" }; @@ -248,7 +248,6 @@ static int xerror(Display *dpy, XErrorEvent *ee); static int xerrordummy(Display *dpy, XErrorEvent *ee); static int xerrorstart(Display *dpy, XErrorEvent *ee); static void zoom(const Arg *arg); -static void autostart_exec(void); /* variables */ static const char broken[] = "broken"; @@ -297,34 +296,6 @@ struct Pertag { /* compile-time check if all tags fit into an unsigned int bit array. */ struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; -/* dwm will keep pid's of processes from autostart array and kill them at quit */ -static pid_t *autostart_pids; -static size_t autostart_len; - -/* execute command from autostart array */ -static void -autostart_exec() { - const char *const *p; - size_t i = 0; - - /* count entries */ - for (p = autostart; *p; autostart_len++, p++) - while (*++p); - - autostart_pids = malloc(autostart_len * sizeof(pid_t)); - for (p = autostart; *p; i++, p++) { - if ((autostart_pids[i] = fork()) == 0) { - setsid(); - execvp(*p, (char *const *)p); - fprintf(stderr, "dwm: execvp %s\n", *p); - perror(" failed"); - _exit(EXIT_FAILURE); - } - /* skip arguments */ - while (*++p); - } -} - /* function implementations */ void applyrules(Client *c) @@ -1467,16 +1438,6 @@ propertynotify(XEvent *e) void quit(const Arg *arg) { - size_t i; - - /* kill child processes */ - for (i = 0; i < autostart_len; i++) { - if (0 < autostart_pids[i]) { - kill(autostart_pids[i], SIGTERM); - waitpid(autostart_pids[i], NULL, 0); - } - } - if(arg->i) restart = 1; running = 0; } @@ -1874,25 +1835,9 @@ showhide(Client *c) void sigchld(int unused) { - pid_t pid; - if (signal(SIGCHLD, sigchld) == SIG_ERR) die("can't install SIGCHLD handler:"); - while (0 < (pid = waitpid(-1, NULL, WNOHANG))) { - pid_t *p, *lim; - - if (!(p = autostart_pids)) - continue; - lim = &p[autostart_len]; - - for (; p < lim; p++) { - if (*p == pid) { - *p = -1; - break; - } - } - - } + while (0 < waitpid(-1, NULL, WNOHANG)); } void @@ -2496,7 +2441,6 @@ main(int argc, char *argv[]) if (!(dpy = XOpenDisplay(NULL))) die("dwm: cannot open display"); checkotherwm(); - autostart_exec(); setup(); #ifdef __OpenBSD__ if (pledge("stdio rpath proc exec", NULL) == -1) |