Add gpg-agent config
This commit is contained in:
parent
9fb504ed63
commit
5371a9e12b
30
.zshenv
30
.zshenv
@ -6,3 +6,33 @@ export STEAMAPPS="$HOME/.local/share/Steam/steamapps/common"
|
|||||||
export QT_STYLE_OVERRIDE=gtk
|
export QT_STYLE_OVERRIDE=gtk
|
||||||
export ALTERNATE_EDITOR=""
|
export ALTERNATE_EDITOR=""
|
||||||
export TERMINAL=roxterm
|
export TERMINAL=roxterm
|
||||||
|
|
||||||
|
# Set temporary files locations
|
||||||
|
if [[ ! -d "$TMPDIR" ]]; then
|
||||||
|
export TMPDIR="/tmp/$LOGNAME"
|
||||||
|
mkdir -p -m 700 "$TMPDIR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
TMPPREFIX="${TMPDIR%/}/zsh"
|
||||||
|
if [[ ! -d "$TMPPREFIX" ]]; then
|
||||||
|
mkdir -p "$TMPPREFIX"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Gnupg setup
|
||||||
|
## Start the gpg-agent if not already running
|
||||||
|
if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then
|
||||||
|
gpg-connect-agent /bye >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Set SSH to use gpg-agent
|
||||||
|
unset SSH_AGENT_PID
|
||||||
|
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
|
||||||
|
export SSH_AUTH_SOCK="${HOME}/.gnupg/S.gpg-agent.ssh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Set GPG TTY
|
||||||
|
GPG_TTY=$(tty)
|
||||||
|
export GPG_TTY
|
||||||
|
|
||||||
|
## Refresh gpg-agent tty in case user switches into an X session
|
||||||
|
gpg-connect-agent updatestartuptty /bye >/dev/null
|
||||||
|
Loading…
Reference in New Issue
Block a user