X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/8650c486663161fc96e7aa837709971b8a02359d..4fa653d992e741dd96b3c58a265b2fb71cd8b0b7:/bin/pinentry?ds=sidebyside diff --git a/bin/pinentry b/bin/pinentry index 52fd48a..5a31bd4 100755 --- a/bin/pinentry +++ b/bin/pinentry @@ -1,9 +1,9 @@ #!/bin/sh # https://kevinlocke.name/bits/2019/07/31/prefer-terminal-for-gpg-pinentry -set -Ce -gfx="gnome gtk-2 gtk qt x11" -tty="curses tty" +set -C +gfx="qt gnome gtk-4 gtk-3 gtk-2 gtk bemenu dmenu x11" +tty="curses-ss curses tty" case "${PINENTRY_USER_DATA-}" in # prefer tty unless USE_TTY is 0 *USE_TTY=0*) list="$gfx $tty";; @@ -11,10 +11,13 @@ case "${PINENTRY_USER_DATA-}" in esac for x in $list; do - p=which "pinentry-$x" 2>/dev/null + p=$(command -v "pinentry-$x") if [ $? = 0 ]; then exec "$p" "$@" fi done +# fallback +exec pinentry "$@" + echo "No pinentry program found" >&2