ZSH dotfiles how to manage | integration of variables/paths from bash | pitfalls

I did put my request here in the water cooler because I not really know where it would belong.
Would like to make the discussion here and not on Ask, because here we also have a audience with a wider range of knowledge and needs.

I saw a Video about dot-files and i was quite impressed to manage them on the fly and have them stored in a git repository while document the changes.

The bold link shows the Video on the position where

  • My first question came up
    I Asked my selves where to declare the mentioned paths/variables that I do have them available if I log in Wayland or X. Is there a way to “marrie” them, to have them available independent if I just use a shell without a DE, terminal app independent of Wayland or X. The author of the Video solved it for X on a Arch distribution:

The above mentioned path from the dotfile of the Author from the Video.

#XDG Paths

export XDG_CONFIG_HOME=$HOME/.config
export XDG_CACHE_HOME=$HOME/.cache
export XDG_DATA_HOME=$HOME/.local/share

# zsh config dir
export ZDOTDIR=$HOME/.config/zsh

I tried to test, but I realized very fast, that this gives a big mess while re-login after every change and sometimes also needed to restart.

By the way I made some more searches and also got the article in the Fedoramagazine

My difficulties so far I already related in Ask. If you have some solutions ready for it, you could relate it there.

The objective here would be to have a “Brainstorming” how to achieve it while working in Wayland and X.

Note that commands like that work very well for the running terminal but only last as long as that terminal is open & in use. Export puts the value into the current environment but not into the system as a whole when run from a cli.

For those kinds of things to always be effective system wide for a user when that user logs in, opens another terminal window, etc. they need to be inside a script that is activated when the user logs in. Either /etc/zprofile, or $HOME/.zprofile for non-terminal gui environments, or /etc/zshrc or $HOME/.zshrc for terminal logins & terminal windows.