[FEATURE] Restructure Zsh config to follow XDG Base Directory

Aperta
#1,825 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@mylinuxforwork ci sta già lavorando.

Dal 6/9/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

enhancement
Is your feature request related to a problem? Please describe.

The current Zsh setup places .zshrc directly in home directory and links configs from ~/.config/zshrc/ or .zshrc_custom file that may be created in home directory. Moreover, runtime files like .zsh_history and zcompdump files end up directly in the home directory, polluting the root of home directory.

Potential conflict with existing ZDOTDIR in ~/.zshenv:
If a user already has a ~/.zshenv setting ZDOTDIR (e.g., pointing to ~/.config/zsh), Zsh will search for .zshrc inside $ZDOTDIR and completely ignore the ~/.zshrc file generated/placed by the ML4W installer in home directory. Moving to a native ZDOTDIR architecture prevents this conflict and ensures ML4W configs are loaded predictably.

Describe the solution you'd like
  • Instead of putting .zshrc in home directory, create a minimalist ~/.zshenv file that sets export ZDOTDIR="$HOME/.config/zsh".
  • Move all Zsh configuration files (.zshrc, aliases, plugins and etc) inside $ZDOTDIR/ (~/.config/zsh/).
  • Explicitly set paths inside Zsh config for history and completion dump files to keep home dir clean:
# History
HISTFILE="$ZDOTDIR/.zsh_history"

# Cache
## check if cache folder env exists and set if not
: "${XDG_CACHE_HOME:=$HOME/.cache}"

## check if ZSH folder exists in .cache folder and create if not
[[ -d "$XDG_CACHE_HOME/zsh" ]] || mkdir -p "$XDG_CACHE_HOME/zsh"

## set folder for ZSH cache
autoload -Uz compinit
compinit -d "$XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION"
Describe alternatives you've considered

No response

Additional context

Following the XDG Base Directory Specification makes dotfiles much cleaner, modular, and easier to backup/manage.

Support or Contribution
Lingua principale
QML
Stelle
5.1k
Fork
386
Merge medio
16h 45m
PR unite (30g)
14

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mylinuxforwork/dotfiles

Tutte le issue di mylinuxforwork/dotfiles

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.