X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/6d4ce4aad79a55ca78eb0cc6f6795904205c3cc8..b8f9db11f3dfc4edd4baf9cbec8a8208b5d8906b:/etc/zsh/.zshenv diff --git a/etc/zsh/.zshenv b/etc/zsh/.zshenv index 0d58076..f43343b 100644 --- a/etc/zsh/.zshenv +++ b/etc/zsh/.zshenv @@ -63,7 +63,7 @@ function _sev_setpath { # XXX: XDG specifies ~/.local/bin as the only user-writable dir for # executables, but we specify more; technically this is against spec local -a syspath=("$path[@]") - path=({{${_sev_home:-~},~}{/.local,},{$PREFIX,}{,/opt,/opt/*{/*,},/usr{,/local,/pkg}}}/{s,}bin(N) + path=({{${_sev_home:-~},~}{/.local,},{$PREFIX,}{,/usr{,/local,/pkg},/opt,/opt/*{/*,}}}/{s,}bin(N) {$PREFIX,}/usr/{X11R{7,6}/bin,games} # emulate Arch Linux flatpak-bindir.sh for use on other systems {${XDG_DATA_HOME:-~/.local/share},{$PREFIX,}/var/lib}/flatpak/exports/bin) @@ -103,7 +103,7 @@ export LANG=${LANG:-en_US.UTF-8} [[ -v _sev_home ]] || export _sev_home=$HOME ## fix broken term -# NOTE: we do this here instead of .zshrc since we might echo stuff +# NOTE: we do this here instead of .zshrc since we might print stuff if [[ -t 1 ]] { # only if stdout is tty [[ ! -v TERM ]] && export TERM=xterm-256color >/dev/null 2>&1 if [[ $#terminfo -eq 0 ]] { @@ -149,7 +149,7 @@ if [[ ! -v _sev_setup_path || -o login ]] { # chances of that are slim. if [[ ! -v _sev_tmp ]] { # create personal TMPDIR under system tmp - t=${TMPDIR:-${TEMPDIR:-${TEMP:-${TMP:-/tmp}}}}/.home-$LOGNAME + t=${TMPDIR:-${TEMPDIR:-${TEMP:-${TMP:-${${TMPPREFIX%/zsh}:-/tmp}}}}}/.home-$LOGNAME [[ -e $t ]] || mkdir -m700 $t 2>/dev/null _sev_tmp=~/.local/tmp if [[ ! -d $t ]] { @@ -188,7 +188,7 @@ if [[ ! -v _sev_tmp ]] { print -P "%F{red}!!! Can't create session tmp subdir $t, using $_sev_tmp%f" t=$_sev_tmp fi - export _sev_tmp TMPDIR=$t TEMPDIR=$t TEMP=$t TMP=$t + export _sev_tmp TMPDIR=$t TEMPDIR=$t TEMP=$t TMP=$t TMPPREFIX=$t/zsh } unset t }