diff options
| author | Nikita Langer <nikitalanger@icloud.com> | 2026-04-06 22:13:26 +0200 |
|---|---|---|
| committer | Nikita Langer <nikitalanger@icloud.com> | 2026-04-06 22:13:26 +0200 |
| commit | dad6dc77433e661b54458978cb888fd38ae15a97 (patch) | |
| tree | ed0ea2232063526124609e8e1fde67bdff72031d /modules/autostart | |
| download | vxwm-dad6dc77433e661b54458978cb888fd38ae15a97.tar.gz vxwm-dad6dc77433e661b54458978cb888fd38ae15a97.tar.bz2 vxwm-dad6dc77433e661b54458978cb888fd38ae15a97.tar.xz vxwm-dad6dc77433e661b54458978cb888fd38ae15a97.zip | |
Diffstat (limited to 'modules/autostart')
| -rw-r--r-- | modules/autostart/autostart.c | 18 | ||||
| -rw-r--r-- | modules/autostart/autostart.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/modules/autostart/autostart.c b/modules/autostart/autostart.c new file mode 100644 index 0000000..d947972 --- /dev/null +++ b/modules/autostart/autostart.c @@ -0,0 +1,18 @@ +void +runautostart(void) +{ + const char *const *cmd = autostart; + + if (fork() == 0) { + setsid(); + + while (*cmd != NULL) { + if (fork() == 0) { + execl("/bin/sh", "sh", "-c", *cmd, NULL); + exit(1); + } + cmd++; + } + exit(0); + } +} diff --git a/modules/autostart/autostart.h b/modules/autostart/autostart.h new file mode 100644 index 0000000..10a6f88 --- /dev/null +++ b/modules/autostart/autostart.h @@ -0,0 +1 @@ +static void runautostart(void); |
