~mdkcore/dotbins

dotbins/pinentry-auto -rwxr-xr-x 571 bytes
2559c86bRodrigo Oliveira [power] Use loginctl instead of pm-* 1 year, 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

# choose between pinentry-curses and pinentry-qt based on whether
# $PINENTRY_USER_DATA contains USE_CURSES=1
#
# based on:
# https://kevinlocke.name/bits/2019/07/31/prefer-terminal-for-gpg-pinentry/

set -Ceu

# use pinentry-tty if $PINENTRY_USER_DATA contains USE_CURSES=1
# NOTE: unset PINENTRY_USER_DATA if starting X from command line (startx)
case "${PINENTRY_USER_DATA-}" in
    *USE_CURSES=1*)
        exec pinentry-curses "$@"
        ;;
esac

# otherwise, use QT UI
# note: will fallback to curses if $DISPLAY is not available.
exec pinentry-qt "$@"