]>
Commit | Line | Data |
---|---|---|
03b903de | 1 | #!/bin/sh |
2 | # https://kevinlocke.name/bits/2019/07/31/prefer-terminal-for-gpg-pinentry | |
3 | ||
4 | set -Ce | |
5 | graphics="gtk-2 gtk qt x11 gnome" | |
6 | tty="curses tty" | |
7 | case "${PINENTRY_USER_DATA-}" in | |
8 | *USE_TTY=1*) list="$tty $graphics";; | |
9 | *) list="$graphics $tty";; | |
10 | esac | |
11 | ||
12 | for x in $list; do | |
13 | p=which "pinentry-$x" 2>/dev/null | |
14 | if [ $? = 0 ]; then | |
15 | exec "$p" "$@" | |
16 | fi | |
17 | done | |
18 | ||
19 | echo "No pinentry program found" >&2 |