update shell config

This commit is contained in:
2026-07-26 20:20:46 +02:00
parent 64d53d6b8d
commit cdf5c6e541
8 changed files with 95 additions and 59 deletions
+1 -54
View File
@@ -1,56 +1,6 @@
#!/hint/zsh
# Login shell only — runs once per session (like .bash_profile)
# Path helpers (needed before sourcing .profile)
append_path() {
[[ -z "$1" ]] && return
[[ -d "$1" ]] || return
case ":$PATH:" in
*:"$1":*) ;;
*)
PATH="${PATH:+$PATH:}$1"
;;
esac
}
prepend_path() {
[[ -z "$1" ]] && return
[[ -d "$1" ]] || return
case ":$PATH:" in
*:"$1":*) ;;
*)
PATH="$1${PATH:+:$PATH}"
;;
esac
}
# XDG, better than not set
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
export XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
export XDG_STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state}
export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
# Locale, better than not set
if [[ -z "$LANG" ]]; then
export LANG="en_US.UTF-8"
fi
# .profile is not included in the repo (private / per-device)
[[ -f "$HOME/.profile" ]] && . "$HOME/.profile"
# Paths
[[ -f "$HOME/.cargo/env" ]] && source "$HOME/.cargo/env"
(( $+commands[opam] )) && eval "$(opam env)"
prepend_path "$HOME/.cargo/bin"
prepend_path "$HOME/go/bin"
prepend_path "$HOME/.local/bin"
prepend_path "$HOME/.local/scripts"
prepend_path "$HOME/.local/share/fnm"
export PATH
# Login shell only — runs once per session
# GPG agent for SSH
@@ -70,6 +20,3 @@ if (( $+commands[ssh-add] )) && (( $+commands[ssh-agent] )) &&
eval "$($HOME/.local/scripts/ssh-init 2>/dev/null)" &>/dev/null
export UY_USING_SSH_AGENT=1
fi
unfunction append_path
unfunction prepend_path