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)
}
### 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'
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
# 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
enable-ssh-support
-pinentry-program ~/bin/pinentry
+pinentry-program /home/sev/bin/pinentry