summaryrefslogtreecommitdiffstats
path: root/dwl-patches/patches/setupenv
diff options
context:
space:
mode:
authorLeonard Kugis <leonard@kug.is>2025-05-23 11:41:09 +0000
committerLeonard Kugis <leonard@kug.is>2025-05-23 11:41:09 +0000
commitc70505d7c7b7b48600f273357694b56ccf5d2a15 (patch)
tree21c27ac6ffced8d6d904e35bdb39baa5d685d829 /dwl-patches/patches/setupenv
downloaddotfiles-c70505d7c7b7b48600f273357694b56ccf5d2a15.tar.gz
dotfiles-c70505d7c7b7b48600f273357694b56ccf5d2a15.tar.bz2
dotfiles-c70505d7c7b7b48600f273357694b56ccf5d2a15.zip
Initial commitHEADmaster
Diffstat (limited to 'dwl-patches/patches/setupenv')
-rw-r--r--dwl-patches/patches/setupenv/README.md8
-rw-r--r--dwl-patches/patches/setupenv/setupenv.patch54
2 files changed, 62 insertions, 0 deletions
diff --git a/dwl-patches/patches/setupenv/README.md b/dwl-patches/patches/setupenv/README.md
new file mode 100644
index 0000000..776c328
--- /dev/null
+++ b/dwl-patches/patches/setupenv/README.md
@@ -0,0 +1,8 @@
+### Description
+Allow configuring environment variables in config.h
+
+### Download
+- [git branch](https://codeberg.org/notchoc/dwl/src/branch/setupenv)
+- [2024-03-26](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/setupenv/setupenv.patch)
+### Authors
+- [notchoc](https://codeberg.org/notchoc)
diff --git a/dwl-patches/patches/setupenv/setupenv.patch b/dwl-patches/patches/setupenv/setupenv.patch
new file mode 100644
index 0000000..17d2ad4
--- /dev/null
+++ b/dwl-patches/patches/setupenv/setupenv.patch
@@ -0,0 +1,54 @@
+From 11ee2fc23ef5728d1e132f338c08a7805c6109b2 Mon Sep 17 00:00:00 2001
+From: choc <notchoc@proton.me>
+Date: Tue, 26 Mar 2024 21:02:16 +0800
+Subject: [PATCH] implement setupenv
+
+---
+ config.def.h | 5 +++++
+ dwl.c | 7 +++++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 9009517..b16189a 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -20,6 +20,11 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca
+ /* logging */
+ static int log_level = WLR_ERROR;
+
++static const Env envs[] = {
++ /* variable value */
++ { "XDG_CURRENT_DESKTOP", "wlroots" },
++};
++
+ static const Rule rules[] = {
+ /* app_id title tags mask isfloating monitor */
+ /* examples:
+diff --git a/dwl.c b/dwl.c
+index 5867b0c..b7d522b 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -230,6 +230,11 @@ typedef struct {
+ int monitor;
+ } Rule;
+
++typedef struct {
++ const char *variable;
++ const char *value;
++} Env;
++
+ typedef struct {
+ struct wlr_scene_tree *scene;
+
+@@ -2066,6 +2071,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 */
+--
+2.44.0
+