-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discuss: A better way to handle environment variables? #6
Comments
Note that the shell script itself does not set any environment variables (except Managing sway environment though is hard and highly opinionated. With the amount of ways people launch sway, I don't see a solution that I'm comfortable with imposing on the users as a distribution maintainer, therefore I consider that outside of scope of this project.
|
Thanks. Let's consider this resolved for now. If someone has a better idea, they can comment to suggest re-opening the conversation. |
While working on foot server mode socket activation, I had some thoughts about this subject.
(Instead of importing session env variables, it creates a kind of "overlay", which would also obviates the need for cleaning up at the end of the session, if I'm correct) However, that would require going all-in to templated session targets and the like + some amount of machinery (maybe systemd generators or something). Would you be interested in opening another issue to discuss that line of thoughts (given multiples session are an explicit non-goals in the README), since it's a wider scope that just environment variables ? |
@VannTen It's an interesting line of thought, but I agree it deserves a new issue. It sounds like it's really about discussing multiple-session support. |
@VannTen that is a nice approach, but as with any attempt to trick systemd into supporting multiple graphical sessions, it'll have roughly the same set of issues:
I thought I had a longer list, but can't recall anything important right now :( Some of these are not applicable if we explicitly restrict things to a single (templated) session. But then the only benefit we get is to be able to use %i=wayland-n in the units, which doesn't quite need the whole complexity with the environment variables. #15 seems to be almost sufficient for that purpose. |
This project embeds some environment variables in a shell script. It advises modifying the shell script to update the environment variables, which is not ideal.
Is there a better way?
Is systemd's "environment.d" a possible solution?
https://www.freedesktop.org/software/systemd/man/environment.d.html
As a disclosure, I currently use a shell script to set environment variables when starting sway, which I'll include below.
One thing you'll see in this snippet is that there are a number of other environment variables are useful to get toolkits or apps to prioritize Wayland over X11. These would be common modifications to the script shipped here.
The second thing you'll notice is that I start gnome-keyring here. I tried to run
gnome-keyring
as a systemd service but could not get it to work, I think because it needs to export an environment variable in time for other apps that are launched to receive it.So consider that a challenge to test this project and how it handles environment variables-- can it work with
gnome-keyring-daemon
to export SSH_AUTH_SOCK early enough for terminal apps to access it?(If it matters, I'm currently using
ly
as my display manager).The text was updated successfully, but these errors were encountered: