From 9c7860886279977bf5d7a9792bae931ae5363a3f Mon Sep 17 00:00:00 2001 From: Joshua Yun Date: Mon, 31 Mar 2025 23:24:56 -0500 Subject: feat: xwayland display export, environment variables set in dwl --- dwl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'dwl.c') diff --git a/dwl.c b/dwl.c index 30ccf1d..1d8a334 100644 --- a/dwl.c +++ b/dwl.c @@ -260,6 +260,11 @@ typedef struct { int monitor; } Rule; +typedef struct { + const char *variable; + const char *value; +} Env; + typedef struct { struct wlr_scene_tree *scene; @@ -2580,6 +2585,8 @@ run(char *startup_cmd) if (!socket) die("startup: display_add_socket_auto"); setenv("WAYLAND_DISPLAY", socket, 1); + for (size_t i = 0; i < LENGTH(envs); i++) + setenv(envs[i].variable, envs[i].value, 1); /* Start the backend. This will enumerate outputs and inputs, become the DRM * master, etc */ @@ -2599,6 +2606,9 @@ run(char *startup_cmd) } } + /* Added display setup for xwayland-satellite */ + setenv("DISPLAY", ":0", 1); + drawbars(); /* At this point the outputs are initialized, choose initial selmon based on -- cgit v1.2.3