From c5548aaa221bf254f00f75febdc13b99b40cbbb4 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Mon, 22 Jul 2024 17:50:14 +0200 Subject: [PATCH] Make config fully contained in xdg-dir (no ~/.zshenv) --- README.md | 13 +++++++++---- zshenv | 2 -- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 073015d..d43ecfa 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,14 @@ crater's zsh config Installation: ------------- -From the checked out repo: +Set the `ZDOTDIR` environment variable to the directory of this repo. Note that +this environment variable must be set before the user configuration files of zsh +are read. + +One way to do this is to set it in the global zsh configuration in +`/etc/zsh/zshenv`, e.g. to use the XDG basedir spec with this repo at +`~/.config/zsh`: + ``` -ln -s $PWD/zshenv $HOME/.zshenv +export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}"/zsh ``` -The zshenv file sets the location to the rest of the config (`$ZDOTDIR`) -automatically, based on the link target. diff --git a/zshenv b/zshenv index 95bbe34..d7b5b4b 100755 --- a/zshenv +++ b/zshenv @@ -1,5 +1,3 @@ -export ZDOTDIR="${$(readlink $HOME/.zshenv):h:a}" - exists() { command -v "$@" >/dev/null } function(){ local i