Add pass-copy-menu

When selecting a password to copy via `pass-copy` I often don't
remember the name under which I stored the password. Autocomplete in
`pass-copy` helps a bit, but I think a bit more visibility would be
nice.

This PR adds the function `pass-copy-menu`, which displays the
available password entries in a menu. The user can then select or
narrow down an entry via autocompletion.
This commit is contained in:
r0man 2019-04-27 16:48:24 +02:00 committed by Javier Olaechea
parent d2f75c291c
commit 51249507f4
2 changed files with 10 additions and 0 deletions

View file

@ -10,6 +10,8 @@ The following commands will become available:
- =pass-copy=: select an entry to put into the
clipboard. (Auto-completion is available.)
- =pass-copy-menu=: select an entry from a menu to put into the
clipboard.
- =pass-generate=: generate a password for a new given entry and put
it into the clipboard.

View file

@ -24,6 +24,14 @@
(pass-entries))))
(stumpwm:run-shell-command (format nil "pass -c ~a" entry))))
(stumpwm:defcommand pass-copy-menu () ()
"Select a password entry from a menu and copy the password into the clipboard."
(let ((entry (stumpwm:select-from-menu
(stumpwm:current-screen)
(mapcar 'list (pass-entries))
"Copy password to clipboard: ")))
(stumpwm:run-shell-command (format nil "pass -c ~a" (car entry)))))
(stumpwm:defcommand pass-generate () ()
"Generate a password and put it into the clipboard"
(let ((entry-name (stumpwm:read-one-line (stumpwm:current-screen)