From: sev Date: Wed, 21 Oct 2020 12:42:15 +0000 (-0500) Subject: actually set PINENTRY_USER_DATA, fix invocation X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/commitdiff_plain/8650c486663161fc96e7aa837709971b8a02359d?ds=sidebyside;hp=03b903de311946827e690f4db8b082c0ab32dc47 actually set PINENTRY_USER_DATA, fix invocation also some small autoload changes --- diff --git a/base/.zprofile b/base/.zprofile index 82e70e4..a0e4d36 100644 --- a/base/.zprofile +++ b/base/.zprofile @@ -28,8 +28,10 @@ export PYTHONSTARTUP=~/.pythonrc if (( ${+commands[gpg]} )) { # SSH_AUTH_SOCK should be set in a remote SSH session for passthrough # if it isn't, we are likely the first login shell on the local machine - if [[ ! -v SSH_AUTH_SOCK ]] { + # we also want to update USE_TTY if we are the login shell in graphics mode + if [[ ! -v SSH_AUTH_SOCK || -v DISPLAY ]] { export GPG_TTY=$(tty) + export PINENTRY_USER_DATA=USE_TTY=$((! ${+DISPLAY})) gpg-connect-agent UPDATESTARTUPTTY /bye >/dev/null export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) } diff --git a/base/.zshrc b/base/.zshrc index 412c5ba..644e178 100644 --- a/base/.zshrc +++ b/base/.zshrc @@ -177,11 +177,11 @@ esac ### modules & styles ## vcs -autoload -Uz vcs_info zstyle ':vcs_info:*' enable git #zstyle ':vcs_info:git*' check-for-changes true #too slow zstyle ':vcs_info:git*:dotfiles' check-for-changes true zstyle ':vcs_info:git*' check-for-staged-changes true +autoload -Uz vcs_info ## compinit zstyle ':completion:*' auto-description '[arg] %d' @@ -198,8 +198,6 @@ zstyle ':completion:*' menu select=1 zstyle ':completion:*' original false zstyle ':completion:*' select-prompt '%B%l%b' zstyle ':completion:*' verbose true -zstyle :compinstall filename '/home/ds6/.zshrc' - autoload -Uz compinit && compinit ## prompt diff --git a/bin/pinentry b/bin/pinentry index 7b83ff5..52fd48a 100755 --- a/bin/pinentry +++ b/bin/pinentry @@ -2,11 +2,12 @@ # https://kevinlocke.name/bits/2019/07/31/prefer-terminal-for-gpg-pinentry set -Ce -graphics="gtk-2 gtk qt x11 gnome" +gfx="gnome gtk-2 gtk qt x11" tty="curses tty" case "${PINENTRY_USER_DATA-}" in - *USE_TTY=1*) list="$tty $graphics";; - *) list="$graphics $tty";; + # prefer tty unless USE_TTY is 0 + *USE_TTY=0*) list="$gfx $tty";; + *) list="$tty $gfx";; esac for x in $list; do diff --git a/gpg/gpg-agent.conf b/gpg/gpg-agent.conf index 8075100..95a2898 100644 --- a/gpg/gpg-agent.conf +++ b/gpg/gpg-agent.conf @@ -1,2 +1,2 @@ enable-ssh-support -pinentry-program ~/bin/pinentry +pinentry-program /home/sev/bin/pinentry