Add setupenv patch

This commit is contained in:
Sravan Balaji
2024-09-22 21:00:20 -04:00
parent 8c9439a119
commit 089bb41dab
6 changed files with 113 additions and 0 deletions

11
dwl.c
View File

@@ -276,6 +276,13 @@ typedef struct {
int monitor;
} Rule;
#if SETUPENV_PATCH
typedef struct {
const char *variable;
const char *value;
} Env;
#endif // SETUPENV_PATCH
typedef struct {
struct wlr_scene_tree *scene;
@@ -2880,6 +2887,10 @@ run(char *startup_cmd)
if (!socket)
die("startup: display_add_socket_auto");
setenv("WAYLAND_DISPLAY", socket, 1);
#if SETUPENV_PATCH
for (size_t i = 0; i < LENGTH(envs); i++)
setenv(envs[i].variable, envs[i].value, 1);
#endif // SETUPENV_PATCH
/* Start the backend. This will enumerate outputs and inputs, become the DRM
* master, etc */