feat: use xdg spec
This commit is contained in:
parent
531f213f48
commit
a508364ae9
@ -4,7 +4,25 @@ configure() {
|
|||||||
autoload -U +X bashcompinit && bashcompinit
|
autoload -U +X bashcompinit && bashcompinit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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_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
|
||||||
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
|
set-xdg-vars
|
||||||
|
|
||||||
local wkdir="${BASE_ZSH_CONFIG_DIR}/config"
|
local wkdir="${BASE_ZSH_CONFIG_DIR}/config"
|
||||||
source "${wkdir}/themes/init.zsh"
|
source "${wkdir}/themes/init.zsh"
|
||||||
source "${wkdir}/profile/init.zsh"
|
source "${wkdir}/profile/init.zsh"
|
||||||
|
@ -36,7 +36,7 @@ configure() {
|
|||||||
|
|
||||||
init() {
|
init() {
|
||||||
local wkdir="${BASE_ZSH_CONFIG_DIR}/config/omz"
|
local wkdir="${BASE_ZSH_CONFIG_DIR}/config/omz"
|
||||||
export ZSH="${HOME}/.local/share/omz"
|
export ZSH="${XDG_DATA_HOME}/omz"
|
||||||
export ZSH_CUSTOM="${wkdir}/"
|
export ZSH_CUSTOM="${wkdir}/"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
export PATH="${PATH}:${HOME}/.local/bin"
|
export PATH="${PATH}:${XDG_BIN_HOME}"
|
||||||
|
|
||||||
### Shell ###
|
### Shell ###
|
||||||
export LANG=en_US.UTF-8
|
export LANG=en_US.UTF-8
|
||||||
@ -9,19 +9,19 @@ export ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=2
|
|||||||
export ZSH_AUTOSUGGEST_STRATEGY=(history completion)
|
export ZSH_AUTOSUGGEST_STRATEGY=(history completion)
|
||||||
|
|
||||||
### Autojump ###
|
### Autojump ###
|
||||||
source "${HOME}/.local/share/autojump/etc/profile.d/autojump.sh"
|
source "${XDG_DATA_HOME}/autojump/etc/profile.d/autojump.sh"
|
||||||
export PATH="${PATH}:${HOME}/.local/share/autojump/bin"
|
export PATH="${PATH}:${XDG_DATA_HOME}/autojump/bin"
|
||||||
|
|
||||||
### FZF ###
|
### FZF ###
|
||||||
function zvm_after_init() {
|
function zvm_after_init() {
|
||||||
[[ -r "${HOME}/.config/fzf/fzf.zsh" ]] && source "${HOME}/.config/fzf/fzf.zsh"
|
[[ -r "${XDG_CONFIG_HOME}/fzf/fzf.zsh" ]] && source "${XDG_CONFIG_HOME}/fzf/fzf.zsh"
|
||||||
}
|
}
|
||||||
export FZF_DEFAULT_COMMAND='fd --hidden --exclude .git --color=always'
|
export FZF_DEFAULT_COMMAND='fd --hidden --exclude .git --color=always'
|
||||||
export FZF_DEFAULT_OPTS="--height=80% --layout=reverse --info=inline --border --margin=1 --ansi"
|
export FZF_DEFAULT_OPTS="--height=80% --layout=reverse --info=inline --border --margin=1 --ansi"
|
||||||
export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
|
export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
|
||||||
|
|
||||||
### Python ###
|
### Python ###
|
||||||
export PYENV_ROOT="${HOME}/.local/share/pyenv"
|
export PYENV_ROOT="${XDG_DATA_HOME}/pyenv"
|
||||||
export PATH="${PATH}:${PYENV_ROOT}/bin"
|
export PATH="${PATH}:${PYENV_ROOT}/bin"
|
||||||
eval "$(pyenv init -)"
|
eval "$(pyenv init -)"
|
||||||
|
|
||||||
@ -84,9 +84,9 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
### Rust ###
|
### Rust ###
|
||||||
export CARGO_HOME="${HOME}/.local/share/cargo"
|
export CARGO_HOME="${XDG_DATA_HOME}/cargo"
|
||||||
source "${CARGO_HOME}/env"
|
source "${CARGO_HOME}/env"
|
||||||
export RUSTUP_HOME="${HOME}/.local/share/rustup"
|
export RUSTUP_HOME="${XDG_DATA_HOME}/rustup"
|
||||||
export PATH="${PATH}:${CARGO_HOME}/bin"
|
export PATH="${PATH}:${CARGO_HOME}/bin"
|
||||||
|
|
||||||
### Terminal Specific ###
|
### Terminal Specific ###
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
configure() {
|
configure() {
|
||||||
# Enable Caching
|
# Enable Caching
|
||||||
zstyle ':completion:*' use-cache on
|
zstyle ':completion:*' use-cache on
|
||||||
zstyle ':completion:*' cache-path "${HOME}/.cache/.zcompcache"
|
zstyle ':completion:*' cache-path "${XDG_CACHE_HOME}/.zcompcache"
|
||||||
|
|
||||||
### Fzf Tab Configuration ###
|
### Fzf Tab Configuration ###
|
||||||
zstyle ':fzf-tab:*' fzf-pad 100
|
zstyle ':fzf-tab:*' fzf-pad 100
|
||||||
|
Loading…
Reference in New Issue
Block a user