From 228844e6db52a1b77d69b031d70e9dc1599c9f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Sun, 15 Dec 2024 18:43:22 +0100 Subject: [PATCH] Use the ssh-agent service --- .config/zsh/.zshrc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index b79416a..cd6dc9c 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -33,12 +33,8 @@ if [ -f "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting. 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 +# Enable it using `systemctl enable --user ssh-agent.service` +[ -S "$XDG_RUNTIME_DIR/ssh-agent.socket" ] && export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" # Aliases [ -f "$MY_CONFIG/.aliases" ] && . "$MY_CONFIG/.aliases"