pinentry-gnome3 ignores $GTK_THEME
Description
Event Timeline
I would call that a feature because it makes sure that the Pinentry always shows up the same regardless of an application selects a different theme.
The technical reason for this is that the gpg-agent, which pops up the pinentry, uses a list of environment variables to be conveyed from gpg up to pinentry. You can view this list using the command
gpg-connect-agent 'getinfo std_env_names' /bye
I don't know about gpg-agent, but pinentry-gnome3 ignores $GTK_THEME (and $GDK_SCALE) even if I run it directly:
$GTK_THEME=Adwaita:dark GDK_SCALE=2 /usr/bin/pinentry-gnome3 OK Pleased to meet you GETPIN
for comparison pinentry-qt doesn't ignore env:
$ QT_QPA_PLATFORMTHEME=qt5ct QT_SCALE_FACTOR=2 /usr/bin/pinentry-qt (pinentry-qt:25593): dbind-WARNING **: 13:46:01.834: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files qt5ct: using qt5ct plugin OK Pleased to meet you GETPIN
So it's a bug.
Moreover, pinentry-qt doesn't ignore env if it runned from gpg-agent. So you are wrong about technical reason.
$ export QT_QPA_PLATFORMTHEME=qt5ct QT_SCALE_FACTOR=2 $ gpg-agent --daemon --debug-pinentry --grab --pinentry-program /usr/bin/pinentry-qt $ gpg-connect-agent 'getinfo std_env_names' /bye D GPG_TTY D TERM D DISPLAY D XAUTHORITY D XMODIFIERS D GTK_IM_MODULE D DBUS_SESSION_BUS_ADDRESS D QT_IM_MODULE D INSIDE_EMACS D PINENTRY_USER_DATA OK
if you start gpg-agent in that deprecated way it sees the envvars. it will even see them if it is as suggested started on-demand by gpg. However, things are different when a gpg-agent is already running; in that case only the listed envvars are conveyed to the pinentry.
pinentry-gnome delegates to GCR or whatever it is called these day and that daemon has its own configuration.
The upshot is that this is a GNOME issue which you already indicated in the title.