From 061085232ef35f956316812806875331f175acf7 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Tue, 19 Oct 2021 23:18:47 -0400 Subject: Small patch to allow environment variables to be changed on the fly when DWM is reloaded. --- dwm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dwm.c') diff --git a/dwm.c b/dwm.c index cb4113f..8bcd0d2 100644 --- a/dwm.c +++ b/dwm.c @@ -43,6 +43,7 @@ #include "drw.h" #include "util.h" +#include "util2.h" /* macros */ #define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) @@ -2142,6 +2143,11 @@ main(int argc, char *argv[]) if (!(dpy = XOpenDisplay(NULL))) die("dwm: cannot open display"); checkotherwm(); + + FILE *fh; + if ((fh = fopen(".env", "r"))) + readEnv(fh); + setup(); #ifdef __OpenBSD__ if (pledge("stdio rpath proc exec", NULL) == -1) -- cgit v1.2.3