dwm

My fork of https://dwm.suckless.org/
git clone https://git.inz.fi/dwm/
Log | Files | Refs | README | LICENSE

commit 0c8fd0423db8a53f77b59cfe6a3e458345a0ed61
parent 8ca1215b5efee42028551ee21c3bdbdd7a6ce5fc
Author: Santtu Lakkala <inz@inz.fi>
Date:   Tue,  6 Aug 2019 09:52:53 +0300

Run ~/.dwmsession on startup, if exists

Diffstat:
Mdwm.c | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/dwm.c b/dwm.c @@ -2489,6 +2489,21 @@ zoom(const Arg *arg) pop(c); } +void +startup(void) { + char buffer[4096]; + const char *home = getenv("HOME"); + const char *args[] = { NULL, NULL }; + Arg arg; + + snprintf(buffer, sizeof(buffer), "%s/%s", home, ".dwmsession"); + args[0] = buffer; + arg.v = args; + + if (!access(buffer, X_OK)) + spawn(&arg); +} + int main(int argc, char *argv[]) { @@ -2507,6 +2522,7 @@ main(int argc, char *argv[]) die("pledge"); #endif /* __OpenBSD__ */ scan(); + startup(); run(); cleanup(); XCloseDisplay(dpy);