-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add cmd_env and cmd_env_unset to set and unset environment variables at config and runtime #8327
base: master
Are you sure you want to change the base?
Conversation
This is something that can cause unexpected results especially when sway/wlroots consumes the environment variables themselves. Debug environment variables that wlroots uses for e.g. wlr_scene will not honor these environment variables when they are set during runtime. If the other contributors support this idea, it would probably be preferable that the environment variables here only affect applications that are launched using the exec command. |
note: there were already implicit dependencies on glib-2.0, namely by pango
the |
That it does not affect debug variables isn't unexpected, but having Making it strictly for child processes is fine though.
There are no threads here. After the fork, the child process is referencing a copy of all parent process memory and will not see any further changes. No volatile needed. We have historically said no to this. However, arguments about this not being an i3 feature isn't entirely fair as i3 can be restarted with new environment variables mid-session, which cannot be done with sway. But on the other hand, you can already get easy runtime environment adjustment the traditional unix way with:
So I'm split between "this is a simple feature so why not", and "this doesn't allow anything new so why deviate from i3" - especially considering how I'm one to preach wrapper scripts all the time. Maybe I'm slightly in favor because it's so trivial a feature, and the time saved on people asking about how to set environment variables is worth something too. ... But not with a |
sway already (though, indirectly) depends on glib |
i did not have to add that glib dependency, the methods i needed were already in scope, but, i did so if you drop one of the dependencies that also depend on glib it wouldn't break |
To be clear, the issue is not the modification of the |
This reverts commit 8830b1f.
alright i have implemented the part of glib the command needed myself in questionable quality C code. can someone please review this code for soundness? i tested it with ASAN and it seemingly works perfectly. no style checking has been done yet, accepting complaints about that |
can i request a review on this? |
me and a few friends have been using this patch since forever and i wanted to try my luck at upstreaming it… i know this is an opinionated topic and i don't 100% expect this pr to be accepted. it just makes managing environment variables so much easier if you have multiple compositors or if you are using a DM.
update: forgot documentation