diff --git a/dots/.zshrc b/dots/.zshrc index 07787b2..487205d 100644 --- a/dots/.zshrc +++ b/dots/.zshrc @@ -1,3 +1,23 @@ #!/bin/zsh -source ~/.config/zsh/zsh +set-xdg-vars() { + # Based on https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html + # and https://wiki.archlinux.org/title/XDG_Base_Directory + + export XDG_CONFIG_HOME="${HOME}/.config" + export XDG_BIN_HOME="${HOME}/.local/bin" + export XDG_CACHE_HOME="${HOME}/.cache" + export XDG_DATA_HOME="${HOME}/.local/share" + export XDG_STATE_HOME="${HOME}/.local/state" + export XDG_DATA_DIRS="/usr/local/share:/usr/share" + export XDG_CONFIG_DIRS="/etc/xdg" + + # XDG_RUNTIME_DIR + # Not set because this is generally resolved by the underlying system, + # AKA shit can break bad if this is set wrong +} + +set-xdg-vars + +export BASE_ZSH_CONFIG_DIR="${XDG_CONFIG_HOME}/zsh" +source "${BASE_ZSH_CONFIG_DIR}/init.zsh"