refactor(zsh): improve handling of XDG dirs

This commit is contained in:
Price Hiller 2024-01-16 16:41:19 -06:00
parent b9df79bce9
commit 65f1d3c253
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8
2 changed files with 7 additions and 8 deletions

View File

@ -1,13 +1,12 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
configure() { configure() {
export XDG_CONFIG_HOME="${HOME}/.config" export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_CACHE_HOME="${HOME}/.cache" export XDG_CACHE_HOME="${XDG_CONFIG_HOME:-$HOME/.cache}"
export XDG_BIN_HOME="${HOME}/.local/bin" export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_DATA_HOME="${HOME}/.local/share" export XDG_STATE_HOME="${XDG_DATA_HOME:-$HOME/.local/state}"
export XDG_STATE_HOME="${HOME}/.local/state" export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
export XDG_DATA_DIRS="${XDG_DATA_DIRS}:/usr/local/share:/usr/share" export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-/etc/xdg}"
export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS}:/etc/xdg"
} }
init() { init() {

View File

@ -2,7 +2,7 @@
export SAVEHIST=10000 export SAVEHIST=10000
export HISTSIZE=10000 export HISTSIZE=10000
export HISTFILE="${XDG_CACHE_HOME:-"$HOME"}/zsh_history" export HISTFILE="${XDG_CACHE_HOME}/zsh_history"
setopt INC_APPEND_HISTORY setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY setopt SHARE_HISTORY
setopt EXTENDED_HISTORY setopt EXTENDED_HISTORY