X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/830aa39d5a3dcac58bb5ccf41dac57ac13793c66..fed9e7dc14a56be1664bfa5cb63fd23a300af5a8:/bin/pinentry diff --git a/bin/pinentry b/bin/pinentry index 7b83ff5..16c2144 100755 --- a/bin/pinentry +++ b/bin/pinentry @@ -1,16 +1,17 @@ #!/bin/sh # https://kevinlocke.name/bits/2019/07/31/prefer-terminal-for-gpg-pinentry -set -Ce -graphics="gtk-2 gtk qt x11 gnome" -tty="curses tty" +set -C +gfx="gnome qt gtk-4 gtk-3 gtk-2 gtk bemenu dmenu x11" +tty="curses-ss 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 - p=which "pinentry-$x" 2>/dev/null + p=$(which "pinentry-$x") if [ $? = 0 ]; then exec "$p" "$@" fi