X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/e69caf640e206d5736bbac8d9a6dd75e63ec70c0..2bf94bab09ba81e82c23467dcc6260f11e2cf659:/etc/zsh/.zprofile diff --git a/etc/zsh/.zprofile b/etc/zsh/.zprofile index 3bad054..4f11459 100644 --- a/etc/zsh/.zprofile +++ b/etc/zsh/.zprofile @@ -62,10 +62,6 @@ function _sev_zcleanup { unset x p y } -### lang -export CHARSET=${CHARSET:-UTF-8} -export LANG=${LANG:-en_US.UTF-8} - ### path # NOTE: we utilize the fact that unique arrays keep the first occurrence and # remove any further occurences to capture elements from the old PATH @@ -79,9 +75,7 @@ if [[ ! -v _sev_setup_path || -o login ]] { # XXX: XDG specifies ~/.local/bin as the only user-writable dir for # executables, but we specify more; technically this is against spec syspath=("$path[@]") - path=(~/{.local/,}{s,}bin - {~/.local,{$PREFIX,}{,/opt,/usr{,/local,pkg}}}/sbin - {~/.local,{$PREFIX,}{,/opt,/usr{,/local,pkg}}}/bin + path=({{${_sev_home:-~},~}{/.local,},{$PREFIX,}{,/opt,/usr{,/local,/pkg}}}/{s,}bin /usr/{X11R{7,6}/bin,games}) ((len=$#path)) path=("$path[@]" "$syspath[@]") @@ -105,6 +99,17 @@ if [[ ! -v _sev_setup_path || -o login ]] { export _sev_setup_path= } +### autoload to load site specific dotfiles now that fpath is set +autoload -Uz load-site-dotfile + +### load zshenv site-specific +# NOTE: this has to be here since fpath isn't set in .zshenv +load-site-dotfile zshenv + +### lang +export CHARSET=${CHARSET:-UTF-8} +export LANG=${LANG:-en_US.UTF-8} + ### xdg local dir # NOTE: need this for tmp, so confirm it exists. # XXX: perms are not specified for XDG dirs except runtime, but I think 760 @@ -197,7 +202,9 @@ if [[ ! -v _sev_setup_xdg ]] { mkdir -m760 ~/.local/state } - if [[ ! -v XDG_CACHE_HOME ]] { + if [[ -v XDG_CACHE_HOME ]] { + export XDG_CACHE_HOME + } else { if [[ -v _sev_tmp ]] { export XDG_CACHE_HOME=$_sev_tmp/.xdg.cache [[ -e $XDG_CACHE_HOME ]] || mkdir -m700 $XDG_CACHE_HOME @@ -346,8 +353,9 @@ if [[ -v commands[gpg-connect-agent] && ${+DISPLAY} + ${+WAYLAND_DISPLAY} == 0)) # XXX: don't know if gpg-agent supports comments after directives # XXX: path could have # + # XXX: we are assuming this is our pinentry from .local/bin sed -Ei 's#^([[:space:]]*pinentry-program[[:space:]]).*$#\1'${commands[pinentry]:-/dev/null}'#' \ - ${GNUPGHOME:-~/.gnupg}/gpg-agent.conf + ${GNUPGHOME:-~/.gnupg}/gpg-agent.conf 2>/dev/null # XXX: could check for changes before doing this to save perf gpg-connect-agent RELOADAGENT UPDATESTARTUPTTY /bye >/dev/null 2>&1 if {$p} { @@ -429,4 +437,4 @@ unfunction _gpg_socketpath ### load site-specific -if [[ -f ${ZDOTDIR:-~}/.zprofile.local ]] { source ${ZDOTDIR:-~}/.zprofile.local } +load-site-dotfile zprofile