From ace000d4b3b7cadaf0a96b4482edcf3d9d9912f9 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 21 Apr 2012 13:42:47 -0400 Subject: [PATCH] Update ttyname portion of gpg-agent post and link to my gpg-agent-* scripts. --- posts/gpg-agent.mdwn | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/posts/gpg-agent.mdwn b/posts/gpg-agent.mdwn index 53d2d8b..940730b 100644 --- a/posts/gpg-agent.mdwn +++ b/posts/gpg-agent.mdwn @@ -11,12 +11,10 @@ dotfiles maintenance): Start the agent with - $ GPG_TTY=$(tty) - $ gpg-agent --daemon --write-env-file "${HOME}/.gnupg/agent-info" - $ echo "GPG_TTY='${GPG_TTY}'; export GPG_TTY" >> "${HOME}/.gnupg/agent-info" + $ gpg-agent --daemon --display "${DISPLAY}" --ttyname $(TTY) --keep-tty --keep-display --write-env-file "${HOME}/.gnupg/agent-info" $ source "${HOME}/.gnupg/agent-info" -The `GPG_TTY` bit will spawn the `pinentry` call in the designated +The `ttyname` bit will spawn the `pinentry` call in the designated TTY. This avoids troublesome issues like pinentry clobbering [[Mutt]] if they are both using ncurses. @@ -28,6 +26,10 @@ When you are done with the agent, kill it with $ killall gpg-agent $ rm -f "${HOME}/.gnupg/agent-info" +Since these commands are tedious to remember and type, I've wrapped +them in little scripts: [[gpg-agent-spawn.sh]] and +[[gpg-agent-kill.sh]]. + [gpg-agent]: http://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html [[!tag tags/linux]] -- 2.26.2