From a3aa5255a2c4a873fc6368138c138f08ff06fbb9 Mon Sep 17 00:00:00 2001 From: Fredrik Salomonsson Date: Mon, 4 May 2020 11:32:17 -0700 Subject: Added support for default-ok, default-cancel and default-prompt (#7) They now set the `ok-button`, `cancel-button` and `prompt` on the pinentry struct. Rest of the options are still ignored. --- pinentry-rofi.scm | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/pinentry-rofi.scm b/pinentry-rofi.scm index 6580ea1..8490bb9 100755 --- a/pinentry-rofi.scm +++ b/pinentry-rofi.scm @@ -99,8 +99,32 @@ default-cf-visi=Do you really want to make your passphrase visible on the screen default-tt-visi=Make passphrase visible default-tt-hide=Hide passphrase touch-file=/run/user/1000/gnupg/S.gpg-agent" - (let ((option-re (make-regexp "^OPTION (.+)$"))) - (regexp-exec option-re line))) + (let ((regex-match #f) + (option-re (make-regexp "^OPTION (.+)$"))) + (cond + ((set-and-return! regex-match + (regexp-exec + (make-regexp "^OPTION[[:blank:]]+default-ok=(.+)$") line)) + (pinentry-set-button + set-pinentry-ok-button! + pinentry + (match:substring regex-match 1))) + ((set-and-return! regex-match + (regexp-exec + (make-regexp "^OPTION[[:blank:]]+default-cancel=(.+)$") line)) + (pinentry-set-button + set-pinentry-cancel-button! + pinentry + (match:substring regex-match 1))) + ((set-and-return! regex-match + (regexp-exec + (make-regexp "^OPTION[[:blank:]]+default-prompt=(.+)$") line)) + (pinentry-set-mesg + set-pinentry-prompt! + pinentry + (match:substring regex-match 1))) + ((set-and-return! regex-match (regexp-exec option-re line)))) + regex-match)) (define (pinentry-getinfo pinentry line) "Process line if it starts with GETINFO" -- cgit