Skip to content

Commit

Permalink
pinentry: improve pinentry wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
sighook committed Sep 16, 2023
1 parent bdc1931 commit b34cf64
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pinentry/.md5sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
aa2deee67a5ba8316d511f38c7b8cc4a pinentry
175e4f16366cc97fafb36be2da79af2f pinentry
be9b0d4bb493a139d2ec20e9b6872d37 pinentry-1.2.1.tar.bz2
30 changes: 16 additions & 14 deletions pinentry/pinentry
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
#!/bin/sh
# pinentry wrapper
#
# alternatively, you can force a specific front-end by adding the line
# to ~/.gnupg/gpg-agent.conf like the following:
#
# pinentry-program /usr/bin/pinentry-curses
#

if [ -x /usr/bin/pinentry-qt5 ]; then
exec /usr/bin/pinentry-qt5 "$@"
fi

if [ -x /usr/bin/pinentry-qt ]; then
exec /usr/bin/pinentry-qt "$@"
fi

if [ -x /usr/bin/pinentry-gtk-2 ]; then
exec /usr/bin/pinentry-gtk-2 "$@"
fi

if [ -x /usr/bin/pinentry-curses ]; then
if [ -x /usr/bin/pinentry-qt5 ]; then
exec /usr/bin/pinentry-qt5 "$@"
elif [ -x /usr/bin/pinentry-qt ]; then
exec /usr/bin/pinentry-qt "$@"
elif [ -x /usr/bin/pinentry-gtk-2 ]; then
exec /usr/bin/pinentry-gtk-2 "$@"
elif [ -x /usr/bin/pinentry-gnome3 ]; then
exec /usr/bin/pinentry-gnome3 "$@"
elif [ -x /usr/bin/pinentry-curses ]; then
exec /usr/bin/pinentry-curses "$@"
else
echo "no pinentry binary available" >&2
echo "no pinentry binary available" 1>&2
exit 1
fi

Expand Down

0 comments on commit b34cf64

Please sign in to comment.