From: W. Trevor King Date: Sun, 25 Mar 2012 13:10:19 +0000 (-0400) Subject: Add more options to gpg-agent-spawn.sh, and remove GPG_TTY environment var. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=77dca0d137bf9cb0d273915757c182c4e1cb439c;p=blog.git Add more options to gpg-agent-spawn.sh, and remove GPG_TTY environment var. The point of GPG_TTY is to tell gpg-agent what terminal to steal with the pinentry program. Because I like to keep my pinentry bound to the terminal from which I ran gpg-agent-spawn.sh, it's easier to lock gpg-agent into that terminal when I spawn it, and avoid reliance on other terminals setting GPG_TTY appropriately. This should also avoid problems with GPGME, which seems to ignore GPG_TTY. --- diff --git a/posts/gpg-agent/gpg-agent-spawn.sh b/posts/gpg-agent/gpg-agent-spawn.sh index 282f247..1df2b9f 100755 --- a/posts/gpg-agent/gpg-agent-spawn.sh +++ b/posts/gpg-agent/gpg-agent-spawn.sh @@ -2,8 +2,13 @@ # source me! FILE="${HOME}/.gnupg/agent-info" -GPG_TTY=$(tty) -#gpg-agent --daemon --enable-ssh-support --write-env-file "${FILE}" --pinentry-program "/usr/bin/pinentry.py" -gpg-agent --daemon --write-env-file "${FILE}" --pinentry-program "/usr/bin/pinentry.py" -echo "export GPG_AGENT_INFO; GPG_TTY='${GPG_TTY}'; export GPG_TTY" >> "${FILE}" +#todo: --enable-ssh-support +gpg-agent --daemon \ + --display "${DISPLAY}" \ + --ttyname "$(tty)" \ + --keep-tty \ + --keep-display \ + --write-env-file "${FILE}" \ + --pinentry-program "/usr/bin/pinentry.py" +echo "export GPG_AGENT_INFO" >> "${FILE}" source "${FILE}"