refactor(zsh): improve handling of ssh-agent

This commit is contained in:
Price Hiller 2023-12-07 06:39:32 -06:00
parent 10e869744d
commit 0c02db7cc5
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8

View File

@ -59,10 +59,9 @@ export TIMEFMT
export REPORTTIME=600
### SSH ###
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.sock"
ssh-add -l >/dev/null
[ $? -ge 2 ] && ssh-agent -a "$SSH_AUTH_SOCK" -t 24h >/dev/null
export SSH_AUTH_SOCK="${SSH_AUTH_SOCK:-$XDG_RUNTIME_DIR/ssh-agent.sock}"
ssh-add &>/dev/null
[[ "${?}" -gt 2 ]] && eval "$(ssh-agent -a "${SSH_AUTH_SOCK}")" &>/dev/null
### FZF ###
export FZF_DEFAULT_COMMAND='fd --hidden --exclude .git --color=always'