From 16bdf649318e52985d87c2a7f897a5f6eb6871f5 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Fri, 11 Aug 2023 11:16:17 +0200 Subject: feat: make pinentry work both with and without GUI. --- pinentry-rofi.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pinentry-rofi.sh b/pinentry-rofi.sh index 5b4d179..386054f 100755 --- a/pinentry-rofi.sh +++ b/pinentry-rofi.sh @@ -92,8 +92,6 @@ basturlencode () { rofi_cmd="rofi -dmenu -input /dev/null -password" INSIDE_BATS=${INSIDE_BATS:-0} -assuan_send "OK Please go ahead" - win_title="Prompt for password" win_prompt="Password" win_mesg="" @@ -103,6 +101,8 @@ keyinfo="" main () { local temp_str + assuan_send "OK Please go ahead" + while : ; do read -r line log_debug "line=$line" @@ -231,6 +231,10 @@ main () { if [ "$0" = "$BASH_SOURCE" ]; then - main + if [ "$XDG_SESSION_TYPE" != "tty" ] ; then + main + else + exec pinentry-tty "$@" + fi fi -- cgit