src/main.c: add environment variable LABWC_VER

src/config/session.c add env var LABWC_VER
This could be useful going forward for helper programs
such as `labwc-menu-generator` or `labwc-tweaks`
This commit is contained in:
01micko 2024-10-21 11:07:01 +10:00 committed by Johan Malm
parent 3b00aabd93
commit 4d3efb4339
2 changed files with 8 additions and 0 deletions

View file

@ -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);