I decided to do a similar PR again, but now I've delved a little deeper into the topic with variables and how it could be implemented.
In the end, it made sense to enable variables via profile.d, given all its intricacies.
Why didn't I engage the same systemd-environment-generator?
Variables don't work globally
They are triggered only if the program is run in the terminal
A friend also found a feature that if shebang is added to a script, it will work through profile.d, no matter what shell is used.
Also I want to say an obvious problem - variables for Wayland don't work in zsh and fish configs, they have a similar problem as systemd-environment-generator.
I have already tested this script in profile.d, and not only on CachyOS, but also on Fedora, Arch, EndeavourOS - it's working properly.
Greetings!
I decided to do a similar PR again, but now I've delved a little deeper into the topic with variables and how it could be implemented. In the end, it made sense to enable variables via profile.d, given all its intricacies.
Why didn't I engage the same
systemd-environment-generator
?Variables don't work globally
They are triggered only if the program is run in the terminal
A friend also found a feature that if shebang is added to a script, it will work through profile.d, no matter what shell is used.
Also I want to say an obvious problem - variables for Wayland don't work in
zsh
andfish
configs, they have a similar problem assystemd-environment-generator
. I have already tested this script in profile.d, and not only on CachyOS, but also on Fedora, Arch, EndeavourOS - it's working properly.