diff --git a/modules/tools/password-store/autoload.el b/modules/tools/password-store/autoload.el index b4bac0235..b7707aafa 100644 --- a/modules/tools/password-store/autoload.el +++ b/modules/tools/password-store/autoload.el @@ -12,6 +12,19 @@ (after! ivy + (defun +pass-ivy-action--get-field (item) + (let* ((data (auth-pass-parse-entry item)) + (field (if data (completing-read "Field: " (mapcar #'car data) nil t)))) + (if data + (progn + (password-store-clear) + (message "Copied %s's %s field to clipboard. Will clear in %s seconds" + item field (password-store-timeout)) + (kill-new (cdr (assoc field data))) + (setq password-store-timeout-timer + (run-at-time (password-store-timeout) nil 'password-store-clear))) + (error "Couldn't find entry: %s" item)))) + (defun +pass-ivy-action--copy-username (item) (if-let (user (cl-loop with data = (auth-pass-parse-entry item) for key in +pass-user-fields @@ -27,7 +40,8 @@ '(("o" password-store-copy "copy password") ("u" +pass-ivy-action--copy-username "copy username") ("e" password-store-edit "edit entry") - ("b" password-store-url "open url in browser")))) + ("b" password-store-url "open url in browser") + ("f" +pass-ivy-action--get-field "get field")))) ;;;###autoload (defun +pass/ivy (&optional browse-url)