Split bash config into dedicated aliases and profile files. Extract fish shell init from config.fish into composable conf.d fragments (setup, environment, ssh-auth-sock). Remove the generic profile in favor of the bash-specific one. Add a static SSH_AUTH_SOCK symlink so tmux sessions always see the current socket regardless of which shell spawned them.
37 lines
801 B
Bash
37 lines
801 B
Bash
append_path () {
|
|
case ":$PATH:" in
|
|
*:"$1":*)
|
|
;;
|
|
*)
|
|
PATH="${PATH:+$PATH:}$1"
|
|
esac
|
|
}
|
|
|
|
append_path "$HOME/.local/bin"
|
|
append_path "$HOME/.cargo/bin"
|
|
|
|
export PATH
|
|
|
|
if [ test -x $(command -v mise) ]; then
|
|
eval "$(mise activate bash)"
|
|
fi
|
|
|
|
if [ test -x $(command -v zoxide) ]; then
|
|
eval "$(zoxide init bash)"
|
|
fi
|
|
|
|
if [ test -x $(command -v fzf) ]; then
|
|
eval "$(fzf --bash)"
|
|
fi
|
|
|
|
if [ -z "$SSH_CONNECTION" ]; then
|
|
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
|
|
fi
|
|
|
|
# Create a predictable symlink pointing to the current SSH auth socket
|
|
auth_sock="$HOME/.ssh/ssh_auth_sock"
|
|
if [ -n "$SSH_AUTH_SOCK" ] && [ "$SSH_AUTH_SOCK" != "$auth_sock" ]; then
|
|
mkdir -p "$HOME/.ssh"
|
|
ln -sf "$SSH_AUTH_SOCK" "$auth_sock"
|
|
fi
|