plattfot / pinentry-rofi

Rofi frontend to pinentry
44 stars 5 forks source link

Support standard cli options #23

Open jakobkukla opened 3 months ago

jakobkukla commented 3 months ago

pinentry usually supports some standard options including --timeout, --ttyname and --no-global-grab. These are currently missing and break compatibility with tools such as rbw.

See info pinentry.

plattfot commented 3 months ago

Got it. I'll see if I can add these either this weekend or next week. Do you need --no-global-grab though?According to the manual it is just used for debugging and I don't see an option for doing that in rofi.

jakobkukla commented 3 months ago

Actually I'm not sure what --no-global-grab is used for in rbw but they use it here: pinentry.rs#L22.

Just a heads-up: Most pinentry implementations support using a short option for these as well even though they are not documented in info pinentry. From the pinentry-qt help page:

pinentry-qt (pinentry) 1.2.1-unknown
Copyright (C) 2016 g10 Code GmbH
License GPLv2+: GNU GPL version 2 or later <https://www.gnu.org/licenses/>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Usage: pinentry-qt [options] (-h for help)
Ask securely for a secret and print it to stdout.
Options:
 -d, --debug                Turn on debugging output
 -D, --display DISPLAY      Set the X display
 -T, --ttyname FILE         Set the tty terminal node name
 -N, --ttytype NAME         Set the tty terminal type
 -C, --lc-ctype STRING      Set the tty LC_CTYPE value
 -M, --lc-messages STRING   Set the tty LC_MESSAGES value
 -o, --timeout SECS         Timeout waiting for input after this many seconds
 -g, --no-global-grab       Grab keyboard only while window is focused
 -W, --parent-wid           Parent window ID (for positioning)
 -c, --colors STRING        Set custom colors for ncurses
 -a, --ttyalert STRING      Set the alert mode (none, beep or flash)

Please report bugs to <https://bugs.gnupg.org>.

Thanks!

plattfot commented 3 months ago

Hmm, ok. Maybe they have it for debugging purpose or something. I'll see if there is a way to mimic that in rofi, otherwise I'll just make it be a no-op to not break the interface.

And thanks for the heads up! I'll keep that in mind when adding the missing options.

plattfot commented 3 months ago

Ok, got a PR that adds the standard cli interface. Like I said in the PR, most of these options are just dummy options. I hope that's ok.

plattfot commented 2 months ago

Released 2.2.0 which includes #26 which should fix this.