commit d85416e96669aac7762ee6d5752ebd79a01a1260
parent 4e81fcfe28ca46b3642b80fd3eb829cd5d1f8429
Author: Santtu Lakkala <inz@inz.fi>
Date: Tue, 6 Aug 2019 09:52:53 +0300
Run ~/.dwmsession on startup, if exists
Diffstat:
M | dwm.c | | | 16 | ++++++++++++++++ |
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/dwm.c b/dwm.c
@@ -2499,6 +2499,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[])
{
@@ -2517,6 +2532,7 @@ main(int argc, char *argv[])
die("pledge");
#endif /* __OpenBSD__ */
scan();
+ startup();
run();
cleanup();
XCloseDisplay(dpy);