From 3a030059cabd5928c29a0cf1d211e73185d43c50 Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Fri, 2 Oct 2015 20:59:51 +0200 Subject: [PATCH] Updating GPG agent's auto-start. From GPG 2.1, the auto-start mechanism has changed. https://www.gnupg.org/faq/whats-new-in-2.1.html --- .xinitrc | 2 +- .zshrc | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.xinitrc b/.xinitrc index 2d2f9a0..688275b 100755 --- a/.xinitrc +++ b/.xinitrc @@ -4,7 +4,7 @@ hash xcompmgr 2>/dev/null && xcompmgr & hash xscreensaver 2>/dev/null && xscreensaver -no-splash & -hash gpg-agent 2>/dev/null && eval $(gpg-agent --daemon --enable-ssh-support --write-env-file "${HOME}/.gpg-agent-info") +hash gpg-agent 2>/dev/null && eval $(gpg-agent --daemon --enable-ssh-support) DEFAULT_SESSION=qtile [[ ":$PATH:" == *":$HOME/bin:"* ]] || export PATH="$HOME/bin:$PATH" diff --git a/.zshrc b/.zshrc index 649e349..6a31eae 100644 --- a/.zshrc +++ b/.zshrc @@ -42,12 +42,11 @@ if [ -f "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting. 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) +unset SSH_AGENT_PID +if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then + export SSH_AUTH_SOCK="${HOME}/.gnupg/S.gpg-agent.ssh" +fi # Aliases [ "$(uname -s | tr '[:upper:]' '[:lower:]')" = 'linux' ] && alias ls='ls --color=auto'