diff --git a/src/config/session.c b/src/config/session.c index 3238369f..c488c6b4 100644 --- a/src/config/session.c +++ b/src/config/session.c @@ -29,6 +29,7 @@ static const char *const env_vars[] = { "XCURSOR_THEME", "XDG_SESSION_TYPE", "LABWC_PID", + "LABWC_VER", NULL }; diff --git a/src/main.c b/src/main.c index 6d3200cd..147a9e4a 100644 --- a/src/main.c +++ b/src/main.c @@ -191,6 +191,13 @@ main(int argc, char *argv[]) wlr_log(WLR_DEBUG, "LABWC_PID=%s", pid); } + /* useful for helper programs */ + if (setenv("LABWC_VER", LABWC_VERSION, true) < 0) { + wlr_log_errno(WLR_ERROR, "unable to set LABWC_VER"); + } else { + wlr_log(WLR_DEBUG, "LABWC_VER=%s", LABWC_VERSION); + } + if (!getenv("XDG_RUNTIME_DIR")) { wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is unset"); exit(EXIT_FAILURE);