fix pinentry selector in pkgs

This commit is contained in:
ulic-youthlic 2025-01-15 22:56:52 +08:00
parent 3e1a92bac0
commit 597844c60c
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721

View file

@ -5,18 +5,21 @@ pkgs.writeShellApplication {
pinentry-all pinentry-all
]; ];
text = '' text = ''
case $(tty) in if [ -v XDG_SESSION_TYPE ]; then
/dev/tty[1-9]) case $XDG_SESSION_TYPE in
pinentry-curses;; tty)
/dev/pts/*) pinentry-tty;;
if [ -v SSH_CLIENT ] && [ -n "$SSH_CLIENT" ]; then *)
pinentry-curses pinentry-qt;;
else esac
pinentry-qt elif [ -v SSH_CLIENT ] && [ -n "$SSH_CLIENT" ]; then
fi pinentry-tty
;; elif [ -v WAYLAND_DISPLAY ] && [ -n "$WAYLAND_DISPLAY" ]; then
*) pinentry-qt
pinentry-curses;; elif [ -v DISPLAY ] && [ -n "$DISPLAY" ]; then
esac pinentry-qt
else
pinentry-tty
fi
''; '';
} }