From 3ee86078aa81942decf2e6063f8cc393f39dae55 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 17 Jun 2016 10:32:40 +0800 Subject: Update gpg-agent settings --- _gnupg/gpg-agent.conf | 5 ++++- _profile | 8 +++++++- _zsh/90-exports.zsh | 4 +++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/_gnupg/gpg-agent.conf b/_gnupg/gpg-agent.conf index 50a849e..cab106e 100644 --- a/_gnupg/gpg-agent.conf +++ b/_gnupg/gpg-agent.conf @@ -12,9 +12,12 @@ # # Aaron LI # Created: 2014-06-12 -# Updated: 2016-05-15 +# Updated: 2016-06-13 # +# Enable the OpenSSH Agent protocol +enable-ssh-support + # Set the time a cache entry is valid (default: 600 seconds) # Each time a cache entry is accessed, the entry's timer is reset default-cache-ttl 600 diff --git a/_profile b/_profile index 567ca8b..072a288 100644 --- a/_profile +++ b/_profile @@ -4,7 +4,7 @@ # executed by the command interpreter for login shells # # Aaron LI -# Updated: 2016-05-15 +# Updated: 2016-06-13 # @@ -47,6 +47,12 @@ fi ### PATH }}} +### GnuPG +if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then + eval $(gpg-agent --damon --write-env-file "${HOME}/.cache/gpg-agent-info") +fi + + ### Locale export LANG="en_US.UTF-8" export LC_CTYPE="zh_CN.UTF-8" diff --git a/_zsh/90-exports.zsh b/_zsh/90-exports.zsh index 13080a3..e679330 100644 --- a/_zsh/90-exports.zsh +++ b/_zsh/90-exports.zsh @@ -11,7 +11,9 @@ export LESS='--ignore-case --raw-control-chars' # Setup terminal, and turn on colors #export TERM='xterm-256color' -# GPG: see `gpg-agent(1)' +# GnuPG: see 'gpg-agent(1)' export GPG_TTY=$(tty) +# Refresh 'gpg-agent' tty in case user switches into an X session +gpg-connect-agent updatestartuptty /bye >/dev/null # vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=zsh: # -- cgit v1.2.2