diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 0595b90..6387fda 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -32,6 +32,14 @@ if [ -f "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting. . "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" fi +# SSH agent +if ! pgrep -u "$USER" ssh-agent > /dev/null; then + ssh-agent -t 1h > "$XDG_RUNTIME_DIR/ssh-agent.env" +fi +if [[ ! -f "$SSH_AUTH_SOCK" ]]; then + source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null +fi + # Aliases [ -f "$MY_CONFIG/.aliases" ] && . "$MY_CONFIG/.aliases"