diff --git a/private_dot_config/fish/config.fish b/private_dot_config/fish/config.fish index 6e3570c..309ccdb 100644 --- a/private_dot_config/fish/config.fish +++ b/private_dot_config/fish/config.fish @@ -37,13 +37,18 @@ if not set -q fish_inclusion set -eU fish_inclusion end -# Set the ssh keys +# Set the ssh agent if not pgrep ssh-agent > /dev/null eval (ssh-agent -c | string split ';') end set -x SSH_AUTH_SOCK (ssh-agent -s | grep -oP '(?<=SSH_AUTH_SOCK=)[^;]+') -ssh-add ~/.ssh/id_ed25519 &> /dev/null -ssh-add ~/.ssh/hexasec &> /dev/null +# Set the ssh keys +if [ -f ~/.ssh/id_ed25519 ]; and not ssh-add -l | grep -q id_ed25519 + ssh-add ~/.ssh/id_ed25519 > /dev/null 2>&1 +end +if [ -f ~/.ssh/hexasec ]; and not ssh-add -l | grep -q hexasec + ssh-add ~/.ssh/hexasec > /dev/null 2>&1 +end # Set personal aliases # For a full list of active aliases, run `alias`.