diff --git a/patches/autostart/README.md b/patches/autostart/README.md index 976f01f..a53e1b4 100644 --- a/patches/autostart/README.md +++ b/patches/autostart/README.md @@ -1,13 +1,13 @@ -### Description -Allow dwl to execute commands from autostart array in your config.h file. And when you exit dwl all processes from autostart array will be killed. - -Note: Commands from array are executed using execvp(). So if you need to execute shell command you need to prefix it with "sh", "-c" (change sh to any shell you like). - -### Download -- [git branch](https://codeberg.org/sevz/dwl/src/branch/autostart) -- [2024-06-07](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/autostart/autostart.patch) - -### Authors -- [sevz](https://codeberg.org/sevz) -- [Rayan Nakib](https://nakibrayan2.pages.dev/) -- [NFVblog](https://github.com/nf02) +### Description +Allow dwl to execute commands from autostart array in your config.h file. And when you exit dwl all processes from autostart array will be killed. + +Note: Commands from array are executed using execvp(). So if you need to execute shell command you need to prefix it with "sh", "-c" (change sh to any shell you like). + +### Download +- [git branch](https://codeberg.org/sevz/dwl/src/branch/autostart) +- [2024-06-07](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/autostart/autostart.patch) + +### Authors +- [sevz](https://codeberg.org/sevz) +- [Rayan Nakib](https://nakibrayan2.pages.dev/) +- [NFVblog](https://github.com/nf02) diff --git a/patches/autostart/autostart.patch b/patches/autostart/autostart.patch index 9177ff8..20fd3c0 100644 --- a/patches/autostart/autostart.patch +++ b/patches/autostart/autostart.patch @@ -1,4 +1,4 @@ -From 1ea0c8b1ef7fe1c1506d0e475f4c047e78aac79b Mon Sep 17 00:00:00 2001 +From d2829ed5c970c7e7692e39c451526b3860dabb2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Sat, 8 Jul 2023 17:11:36 -0600 @@ -15,7 +15,7 @@ Signed-off-by: Leonardo Hernández Hernández 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/config.def.h b/config.def.h -index a784eb4f..247a25d2 100644 +index 646a3d66..c3ca3a20 100644 --- a/config.def.h +++ b/config.def.h @@ -20,6 +20,13 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca @@ -33,10 +33,10 @@ index a784eb4f..247a25d2 100644 /* app_id title tags mask isfloating monitor */ /* examples: */ diff --git a/dwl.c b/dwl.c -index 6f041a0d..a88c8844 100644 +index 00e9cc1e..5de32831 100644 --- a/dwl.c +++ b/dwl.c -@@ -247,6 +247,7 @@ static void arrange(Monitor *m); +@@ -249,6 +249,7 @@ static void arrange(Monitor *m); static void arrangelayer(Monitor *m, struct wl_list *list, struct wlr_box *usable_area, int exclusive); static void arrangelayers(Monitor *m); @@ -44,7 +44,7 @@ index 6f041a0d..a88c8844 100644 static void axisnotify(struct wl_listener *listener, void *data); static void buttonpress(struct wl_listener *listener, void *data); static void chvt(const Arg *arg); -@@ -426,6 +427,9 @@ static xcb_atom_t netatom[NetLast]; +@@ -429,6 +430,9 @@ static xcb_atom_t netatom[NetLast]; /* attempt to encapsulate suck into one file */ #include "client.h" @@ -54,7 +54,7 @@ index 6f041a0d..a88c8844 100644 /* function implementations */ void applybounds(Client *c, struct wlr_box *bbox) -@@ -574,6 +578,27 @@ arrangelayers(Monitor *m) +@@ -577,6 +581,27 @@ arrangelayers(Monitor *m) } } @@ -82,7 +82,7 @@ index 6f041a0d..a88c8844 100644 void axisnotify(struct wl_listener *listener, void *data) { -@@ -671,11 +696,21 @@ checkidleinhibitor(struct wlr_surface *exclude) +@@ -672,11 +697,21 @@ checkidleinhibitor(struct wlr_surface *exclude) void cleanup(void) { @@ -102,9 +102,9 @@ index 6f041a0d..a88c8844 100644 + } + if (child_pid > 0) { - kill(child_pid, SIGTERM); + kill(-child_pid, SIGTERM); waitpid(child_pid, NULL, 0); -@@ -1434,18 +1469,31 @@ void +@@ -1438,18 +1473,31 @@ void handlesig(int signo) { if (signo == SIGCHLD) { @@ -141,7 +141,7 @@ index 6f041a0d..a88c8844 100644 } else if (signo == SIGINT || signo == SIGTERM) { quit(NULL); } -@@ -2136,6 +2184,7 @@ run(char *startup_cmd) +@@ -2169,6 +2217,7 @@ run(char *startup_cmd) die("startup: backend_start"); /* Now that the socket exists and the backend is started, run the startup command */