t-8ch / pinentry-bemenu

Pinentry based on bemenu
GNU General Public License v3.0
52 stars 3 forks source link

Show on active display #13

Closed kedodrill closed 2 years ago

kedodrill commented 2 years ago

Hi there, I've really been enjoying using this as a pinentry replacement. I currently have a little script I use that runs bemenu to show a list of passwords which shows up on the active display (I have two monitors). Currently, pinentry-bemenu shows up only on my second monitor. Could this be changed easily so it shows up on the active display, like bemenu does it? Totally understand if you're not wanting to do this. Just figured it might be a good addition. :)

Possibly related: https://github.com/Cloudef/bemenu/issues/102

ammgws commented 2 years ago

Doesn't --monitor -1 do that for you? That should show it on the focused monitor according to https://github.com/Cloudef/bemenu/pull/174/files, and pinentry-bemenu passes that along to bemenu so it should work

t-8ch commented 2 years ago

@kedodrill As @ammgws said the same options as for plain bemenu should work.

One exception are the symbolical aliases "focused" and "all". For those you need the numerical values -1 and -2

kedodrill commented 2 years ago

Hmm, where would I put that argument? I'm on void linux and I'm using xbps-alternatives to symlink pinentry-bemenu as a replacement for pinentry. I tried putting pinentry-program /usr/bin/pinentry-bemenu --monitor -1 in gpg-agent.conf, but I'm guessing that broke it because it no longer shows up.

t-8ch commented 2 years ago

@kedodrill Try to create a wrapper script that passes the configuration and use that in gpg-agent.conf

t-8ch commented 2 years ago

@kedodrill Did it work?

kedodrill commented 2 years ago

@t-8ch sorry for the delayed response! I did try a wrapper script but I couldn't get it to work. I'm guessing that void is doing something different here...switching back to the regular pinentry program using xbps-alternatives and then doing as you suggested above resulted in no program loading at all, with a "No pinentry" error. Any ideas?

t-8ch commented 2 years ago

But you did get pinentry-bemenu running without settings, correct? By setting it in gpg-agent.conf? Can you create this script as ~/pinentry-test and test if it works when running it manually and when adding it to gpg-agent.conf?:

#!/bin/sh
exec pinentry-bemenu

(Don't forget to make it executable.)

kedodrill commented 2 years ago

@t-8ch Got it working! I did what you said and then just added the -m -1 that the first comment suggested. not sure why I couldn't get it working before, I swear I had it set up just like that...anyways thank you!

t-8ch commented 2 years ago

Nice to hear!