#
Based on this gist
Simple pinentry gui using rofi written in GNU guile.
It’s similar in functionality as the gist but this one doesn’t force the width to be 27 and doesn’t depend on systemd.
I also wanted a small project which I could use to practice writing GNU guile.
There is a major bug in pinentry-rofi 2.2.0 and below. The password was not encoded before giving it to gpg. Which meant that passwords including character other than alphanumerics from ASCII and `-`, `.`, `_` and `~` ended up being decoded on gpg’s side. Making them not match the input and therefore not work on other pinentry tools. See #27 for details.
Before moving to pinentry-rofi-3.0.0, please make sure to temporarily change the passwords affected by this bug to something that does not include those special characters. Make the upgrade then change back.
An alternative is to figure out what gnupg decoded the passwords too and use that as the input when using pinentry-rofi-3.0.0. And change the passwords to match what they where suppose to be.
Sorry for the headaches.
As of version 2.0.0, pinentry-rofi
is now built using automake.
See HACKING for more info on that. It also lost its -guile
suffix
for the executable. And it is no longer just one file, most of its
content is now a guile module, which the executable now calls.
To install it using guix, run
guix install pinentry-rofi
Just make sure you have a version of `guix` that is newer than Jan 8 2021.
The binary location is then `$HOME/.guix-profile/bin/pinentry-rofi` were the `$HOME` is the home location of the user you used to install it with. E.g. `/home/$USER` for a normal user and `/root` for the root user.
Install it with guix is recommended as that will work on most linux distributions.
Then add it to your ~/.gnupg/gpg-agent.conf
If you are running guix on a foreign distro, you need to make sure
the GUIX_LOCPATH
environment variable is passed to the gpg-agent
otherwise rofi will fail to set the locale and therefore cannot
launch. Which result in the pinentry aborting.
On a distribution that is using systemd (here I’m using Arch Linux as an example) simply run:
echo "GUIX_LOCPATH=$GUIX_LOCPATH"
Copy that, then run:
systend --user edit gpg-agent.service
And add it in the override.conf
:
[Service]
Environment=GUIX_LOCPATH=%h/.guix-profile/lib/locale
On my system, GUIX_LOCPATH
points to the default profile i.e.
$HOME/.guix-profile/lib/locale
. %h
in systemd gives you the
path to the home directory. This should be the case for most
people, but if your GUIX_LOCPATH
points to something different
change the override.conf
to reflect that.
The PKGBUILD
file for arch is in the build-aux
, so just run:
cd build-aux
makepkg -ic
The binary location is then `/usr/bin/pinentry-rofi`.
See HACKING on how to build this from source
To use pinentry-rofi
with gpg-agent
, you can set it as the
pinentry-program
in the ~/.gnupg/gpg-agent.conf
. Note that you
need to use the full path to the binary.
For example for Arch Linux this would be:
pinentry-program /usr/bin/pinentry-rofi
And for guix:
pinentry-program <HOME>/.guix-profile/bin/pinentry-rofi
Where <HOME>
is the full path to home for your user.
Don’t forget to restart gpg-agent
for the changes to take affect:
gpg-connect-agent reloadagent /bye