Open snakeroot opened 10 months ago
The static assignment needed for LANG/MOZ_ENABLE_WAYLAND/QT_QPA_PLATFORM/etc... seems to be already solved with environment.d(5)
, right? What do you want to achieve by parsing environment.d files with another tool and sending the variables to systemd?
There's a finite amount of per-session variables set by a display manager or by a compositor, that need to be injected to systemd dynamically. Most of those are already in the session script, with exception of XCURSOR_*
ones that I simply forgot to add.
Another run at #6 .
Would you consider modifying
session.sh
so that it looks for an "Environment" file in a pre-defined location, and, if the file exists, sources the variables in that file and then adds them to the $VARIABLES list alongside the default variables hardcoded in the script and those passed in via -E?This has the advantage of leveraging a broadly-used format (i.e, you can crib from people using .profile or /etc/environment.d). It also should mean that the file won't get overwritten when sway-systemd is upgraded (unlike changes to -E in
10-systemd-session.conf
).I stuck this language into my
session.sh
and, while it's not pretty it does seem to work:Similarly, would it be possible to do something similar for the transient scope units created by
assign-cgroups.py
? It seems one could parse an Environment file and submit the name/value pairs via the systemd d-bus API's SetEnvironment() method. Since a lot of the commonly-used environment variables are used to persuade GUI programs to use wayland, this might prove useful.