-
Notifications
You must be signed in to change notification settings - Fork 427
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
[Suggestion] Update XDG_CONFIG_HOME when created with --home #420
Comments
It's probably better to set the XDG base dir variables inside of the custom home, and not unset them; we shouldn't be promoting having the variables unset. The user can override them if desired. |
Ignoring After a quick assessment, even adding options to keep them (but reset them based on |
By the way, a quick solution one could use would to go to config file where they are setting the
if [ "$DBX_CONTAINER" = "my-container" ]; then
XDG_CONFIG_HOME=/same/location/used/with/--home
else
XDG_CONFIG_HOME=/path/to/location/of/choice/on/the/host/system
fi This was the different values strategy. if [ "$DBX_CONTAINER" != "my-container" ]; then
XDG_CONFIG_HOME=/path/to/location/of/choice/on/the/host/system
fi And this one, selective setting strategy. Only setting
$ distrobox enter --additional-flags '--env DBX_CONTAINER=my-container' --name my-container-name The basic idea is to set a specific variable in the container environment that can be checked in the shell config file(s). I personally use this kind of logic to selective choose what the config files do based on where the shell is being opened, whether it's on the host or on a (specific) Distrobox container. |
Distrobox already adds |
Yes, for this particular case using |
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
@luc14n0 I have been messing around with
I am running I have tried Summary: sanitized PATH and different shell than host would be huge. I am willing to contribute here. |
Is your feature request related to a problem? Please describe.
I created a distrobox with a separate home for working on some software in a clean environment. I noticed that the software was creating config files in my
$XDG_CONFIG_HOME
, which is set to$HOME/.config
. This was unexpected for me, as setting--home
was specifically so that user configuration files were not loaded.Describe the solution you'd like
Unset
$XDG_CONFIG_HOME
,$XDG_CACHE_HOME
,$XDG_DATA_HOME
, and$XDG_DATA_DIRS
.Describe alternatives you've considered
You could also set
$XDG_
to the standard locations in the container's home, but I think that is making too many assumptions and could be handled by--env
. You could also leave it as is and let the user update--env
, but I think if someone is using--home
they don't want to keep the$XDG_
vars set.The text was updated successfully, but these errors were encountered: