diff --git a/.bashrc b/.bashrc index 6ac7a45..dca9acf 100644 --- a/.bashrc +++ b/.bashrc @@ -36,12 +36,10 @@ else fi # GPG Agent -if [ -f "${HOME}/.gpg-agent-info" ]; then - . "${HOME}/.gpg-agent-info" - export GPG_AGENT_INFO - export SSH_AUTH_SOCK -fi export GPG_TTY=$(tty) +export GPG_AGENT_INFO="/run/user/${UID}/gnupg/S.gpg-agent" +export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh" +export SSH_AGENT_PID=$(pgrep -x -u "${USER}" gpg-agent) # Aliases [ -f "$HOME/.aliases" ] && . "$HOME/.aliases" diff --git a/.zshrc b/.zshrc index 3db724a..c48af36 100644 --- a/.zshrc +++ b/.zshrc @@ -41,10 +41,9 @@ fi # GPG Agent export GPG_TTY=$(tty) -unset SSH_AGENT_PID -if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then - export SSH_AUTH_SOCK="${HOME}/.gnupg/S.gpg-agent.ssh" -fi +export GPG_AGENT_INFO="/run/user/${UID}/gnupg/S.gpg-agent" +export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh" +export SSH_AGENT_PID=$(pgrep -x -u "${USER}" gpg-agent) # Aliases [ -f "$HOME/.aliases" ] && . "$HOME/.aliases"