From b64d5b147a7fff20a11a6496c76b004d64f7babb Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 22 Sep 2023 21:39:06 +0300 Subject: pass.el: Update launcher --- .emacs.d/modules/thanos-pass.el | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to '.emacs.d/modules/thanos-pass.el') diff --git a/.emacs.d/modules/thanos-pass.el b/.emacs.d/modules/thanos-pass.el index 505093b..89a07b9 100644 --- a/.emacs.d/modules/thanos-pass.el +++ b/.emacs.d/modules/thanos-pass.el @@ -43,25 +43,22 @@ (if user (format "sleep 0.3 && xdotool getactivewindow type \"%s\" && xdotool getactivewindow key Tab && xdotool getactivewindow type \"%s\"" user pass) (format "sleep 0.3 && xdotool getactivewindow type 'thanosapollo' && xdotool getactivewindow key Tab && xdotool getactivewindow type \"%s\"" pass)))))) - (let ((ivy-height 100)) + (let ((vertico-count 100)) (unwind-protect - (with-selected-frame - (make-frame '((name . "thanos/pass-launcher") - (minibuffer . only) - (fullscreen . 0) - (undecorated . t) - (internal-border-width . 10) - (width . 80) - (height . 11))) - (let* ((choice (completing-read "Choose an action: " '("AUTO" "COPY PASS" "COPY USERNAME" "EDIT" "GENERATE"))) - (action (pcase choice - ("AUTO" #'pass-autotype) - ("COPY PASS" #'password-store-copy) - ("COPY USERNAME" #'(lambda (entry) (password-store-copy-field entry "user"))) - ("EDIT" #'password-store-edit) - ("GENERATE" #'password-store-generate)))) - (funcall action (completing-read "Search: " (password-store-list))) - (delete-frame))))))) + (with-selected-frame + (make-frame '((name . "thanos/pass-launcher") + (fullscreen . 0) + (undecorated . t) + (minibuffer . only))) + (let* ((choice (completing-read "Choose an action: " '("AUTO" "COPY PASS" "COPY USERNAME" "EDIT" "GENERATE"))) + (action (pcase choice + ("AUTO" #'pass-autotype) + ("COPY PASS" #'password-store-copy) + ("COPY USERNAME" #'(lambda (entry) (password-store-copy-field entry "user"))) + ("EDIT" #'password-store-edit) + ("GENERATE" #'password-store-generate)))) + (funcall action (completing-read "Search: " (password-store-list))) + (delete-frame))))))) (defun smtp-get-pass () "Get password for smtp." @@ -73,6 +70,7 @@ (define-key thanos/pass (kbd "i") 'password-store-insert) (define-key thanos/pass (kbd "e") 'password-store-edit) (define-key thanos/pass (kbd "g") 'password-store-generate) +(define-key thanos/pass (kbd "c") 'password-store-copy) (define-key thanos/pass (kbd "s") 'smtp-get-pass) (defun thanos/app-launcher () -- cgit v1.2.3