refactor: zshrc now sets xdg-vars

This commit is contained in:
Price Hiller 2022-07-31 22:30:14 -05:00
parent 840d64b6aa
commit 49cb10b4c4

View File

@ -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"