]>
Commit | Line | Data |
---|---|---|
830aa39d | 1 | #!/bin/sh |
2 | # https://kevinlocke.name/bits/2019/07/31/prefer-terminal-for-gpg-pinentry | |
3 | ||
e4677c6b | 4 | set -C |
5 | gfx="gnome qt gtk-4 gtk-3 gtk-2 gtk bemenu dmenu x11" | |
6 | tty="curses-ss curses tty" | |
830aa39d | 7 | case "${PINENTRY_USER_DATA-}" in |
30cffb95 | 8 | # prefer tty unless USE_TTY is 0 |
9 | *USE_TTY=0*) list="$gfx $tty";; | |
10 | *) list="$tty $gfx";; | |
830aa39d | 11 | esac |
12 | ||
13 | for x in $list; do | |
ce09f45e | 14 | p=$(command -v "pinentry-$x") |
830aa39d | 15 | if [ $? = 0 ]; then |
16 | exec "$p" "$@" | |
17 | fi | |
18 | done | |
19 | ||
20 | echo "No pinentry program found" >&2 |