7/31/2026 at 4:53:21 PM
I wrap `pinentry` (which is in the dependency trees of gnupg, pacman, gvfs, udisks2 and other software that you can de-facto depend on on desktops) inside my own simple askpass. $ cat ~/scripts/pinentry-askpass
#!/usr/bin/env bash
pinentry <<INPUT | grep '^D ' | cut -c 3-
SETPROMPT Password:
GETPIN
INPUT
$ cat ~/.bashrc | grep ASKPASS
export SUDO_ASKPASS="$HOME/scripts/pinentry-askpass"
export SSH_ASKPASS="$SUDO_ASKPASS"
It automatically launches the GTK, TTY, or QT version depending on your environment.It's also useful for agents to use sudo, you can write in instructions to tool-call `sudo -A` and you get a GUI popup to enter the password, and the agent continues from there. And since the "prompt" in pinentry can be customised... you can get the agent to set up a temporary askpass, which replaces "Password:" in the prompt with questions like "Can I delete this old log file in /var?" and you enter your password to authorise.
by porridgeraisin
8/1/2026 at 2:28:05 PM
Any reason you don't use `pinentry-gnome3` from the `pinentry` package? Your wrapper is clever but doesn't work with gpg-agent.by aorth
8/1/2026 at 3:29:10 PM
No reason, I always thought launching pinentry directly chose the right one out of pinentry, pinentry-curses, pinentry-emacs, pinentry-gnome3, pinentry-gtk, pinentry-qt, pinentry-tty since it always worked for me on xfce+arch+programs I have used.You can change it I suppose, I don't thing I use gpg-agent often.
by porridgeraisin