diff --git a/.bashrc b/.bashrc index 5cd1ea9..905f2f6 100644 --- a/.bashrc +++ b/.bashrc @@ -37,8 +37,8 @@ fi # GPG Agent export GPG_TTY=$(tty) -[ -f "/run/user/${UID}/gnupg/S.gpg-agent" ] && export GPG_AGENT_INFO="/run/user/${UID}/gnupg/S.gpg-agent" -[ -f "/run/user/${UID}/gnupg/S.gpg-agent.ssh" ] && export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh" +[ -S "/run/user/${UID}/gnupg/S.gpg-agent" ] && export GPG_AGENT_INFO="/run/user/${UID}/gnupg/S.gpg-agent" +[ -S "/run/user/${UID}/gnupg/S.gpg-agent.ssh" ] && export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh" pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1 && export SSH_AGENT_PID=$(pgrep -x -u "${USER}" gpg-agent) # Aliases diff --git a/.zshrc b/.zshrc index bdc58ea..d02b040 100644 --- a/.zshrc +++ b/.zshrc @@ -41,8 +41,8 @@ fi # GPG Agent export GPG_TTY=$(tty) -[ -f "/run/user/${UID}/gnupg/S.gpg-agent" ] && export GPG_AGENT_INFO="/run/user/${UID}/gnupg/S.gpg-agent" -[ -f "/run/user/${UID}/gnupg/S.gpg-agent.ssh" ] && export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh" +[ -S "/run/user/${UID}/gnupg/S.gpg-agent" ] && export GPG_AGENT_INFO="/run/user/${UID}/gnupg/S.gpg-agent" +[ -S "/run/user/${UID}/gnupg/S.gpg-agent.ssh" ] && export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh" pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1 && export SSH_AGENT_PID=$(pgrep -x -u "${USER}" gpg-agent) # Aliases