Gpg-agent: make pinentry-qt respect the system theme

Hello,

I am using SwayWM with mostly qt apps and manage themes with qt5ct.
Everything works fine except pinentry-qt which does not respect the theme when invoked by gpg-agent.
Since it actually does respect the theme when invoked by my user, I assumed the problem was that the gpg-agent.service systemd user service was lacking the correct environment variables:

QT_QPA_PLATFORM=wayland
QT_QPA_PLATFORMTHEME=qt5ct

However, even upon setting the correct env to systemd, by

  systemd.user.sessionVariables = {
    QT_QPA_PLATFORM = "wayland";
    QT_QPA_PLATFORMTHEME = "qt5ct";
  };

I am still not getting a correctly themed pinentry-qt.
Even though now I have:

$ systemctl --user show-environment | grep QT_QPA
QT_QPA_PLATFORM=wayland
QT_QPA_PLATFORMTHEME=qt5ct

and

$ xargs -0 -L1 -a /proc/$(pgrep gpg-agent)/environ | grep QT_QPA
QT_QPA_PLATFORM=wayland
QT_QPA_PLATFORMTHEME=qt5ct

Any idea what might be the issue here which causes the theme to not be respected by pinentry when invoked by gpg-agent?

Thanks!

2 Likes

Did you find a solution?

Nope, I just switched to the gnome pinentry and now theming works.

1 Like