update autostart

13925eb1da8af2c1d23ee9d01efd03c3626081b2

Closes: https://codeberg.org/dwl/dwl-patches/issues/86
This commit is contained in:
Leonardo Hernández Hernández 2024-06-25 00:46:57 -06:00
parent 438bef0317
commit b629632b7c
No known key found for this signature in database
GPG Key ID: E538897EE11B9624
2 changed files with 23 additions and 23 deletions

View File

@ -1,13 +1,13 @@
### Description ### 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. 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). 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 ### Download
- [git branch](https://codeberg.org/sevz/dwl/src/branch/autostart) - [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) - [2024-06-07](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/autostart/autostart.patch)
### Authors ### Authors
- [sevz](https://codeberg.org/sevz) - [sevz](https://codeberg.org/sevz)
- [Rayan Nakib](https://nakibrayan2.pages.dev/) - [Rayan Nakib](https://nakibrayan2.pages.dev/)
- [NFVblog](https://github.com/nf02) - [NFVblog](https://github.com/nf02)

View File

@ -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?= From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
<leohdz172@proton.me> <leohdz172@proton.me>
Date: Sat, 8 Jul 2023 17:11:36 -0600 Date: Sat, 8 Jul 2023 17:11:36 -0600
@ -15,7 +15,7 @@ Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
2 files changed, 61 insertions(+), 5 deletions(-) 2 files changed, 61 insertions(+), 5 deletions(-)
diff --git a/config.def.h b/config.def.h diff --git a/config.def.h b/config.def.h
index a784eb4f..247a25d2 100644 index 646a3d66..c3ca3a20 100644
--- a/config.def.h --- a/config.def.h
+++ b/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 @@ -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 */ /* app_id title tags mask isfloating monitor */
/* examples: */ /* examples: */
diff --git a/dwl.c b/dwl.c diff --git a/dwl.c b/dwl.c
index 6f041a0d..a88c8844 100644 index 00e9cc1e..5de32831 100644
--- a/dwl.c --- a/dwl.c
+++ b/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, static void arrangelayer(Monitor *m, struct wl_list *list,
struct wlr_box *usable_area, int exclusive); struct wlr_box *usable_area, int exclusive);
static void arrangelayers(Monitor *m); static void arrangelayers(Monitor *m);
@ -44,7 +44,7 @@ index 6f041a0d..a88c8844 100644
static void axisnotify(struct wl_listener *listener, void *data); static void axisnotify(struct wl_listener *listener, void *data);
static void buttonpress(struct wl_listener *listener, void *data); static void buttonpress(struct wl_listener *listener, void *data);
static void chvt(const Arg *arg); 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 */ /* attempt to encapsulate suck into one file */
#include "client.h" #include "client.h"
@ -54,7 +54,7 @@ index 6f041a0d..a88c8844 100644
/* function implementations */ /* function implementations */
void void
applybounds(Client *c, struct wlr_box *bbox) 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 void
axisnotify(struct wl_listener *listener, void *data) 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 void
cleanup(void) cleanup(void)
{ {
@ -102,9 +102,9 @@ index 6f041a0d..a88c8844 100644
+ } + }
+ +
if (child_pid > 0) { if (child_pid > 0) {
kill(child_pid, SIGTERM); kill(-child_pid, SIGTERM);
waitpid(child_pid, NULL, 0); waitpid(child_pid, NULL, 0);
@@ -1434,18 +1469,31 @@ void @@ -1438,18 +1473,31 @@ void
handlesig(int signo) handlesig(int signo)
{ {
if (signo == SIGCHLD) { if (signo == SIGCHLD) {
@ -141,7 +141,7 @@ index 6f041a0d..a88c8844 100644
} else if (signo == SIGINT || signo == SIGTERM) { } else if (signo == SIGINT || signo == SIGTERM) {
quit(NULL); quit(NULL);
} }
@@ -2136,6 +2184,7 @@ run(char *startup_cmd) @@ -2169,6 +2217,7 @@ run(char *startup_cmd)
die("startup: backend_start"); die("startup: backend_start");
/* Now that the socket exists and the backend is started, run the startup command */ /* Now that the socket exists and the backend is started, run the startup command */