summaryrefslogtreecommitdiff
path: root/.emacs.d
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-09-26 15:18:57 +0300
committerThanos Apollo <[email protected]>2023-09-26 15:18:57 +0300
commit6f245e727fcd7d68877859c5de332eec894fab44 (patch)
treecdd2d60beebc1cc39f4b29948773360beffcd771 /.emacs.d
parent50e5019c2b4d4f3bf35fdb5fc6add519e53d0987 (diff)
[emacs] Fix pass launcher
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/modules/thanos-pass.el25
1 files changed, 12 insertions, 13 deletions
diff --git a/.emacs.d/modules/thanos-pass.el b/.emacs.d/modules/thanos-pass.el
index 89a07b9..e3e805d 100644
--- a/.emacs.d/modules/thanos-pass.el
+++ b/.emacs.d/modules/thanos-pass.el
@@ -35,30 +35,29 @@
(defun thanos/pass-launcher ()
"Launch Emacs as a front-end for pass."
(interactive)
- (cl-flet ((pass-autotype (entry)
- (let ((user (password-store-get-field entry "user"))
- (pass (password-store-get entry)))
- (start-process-shell-command
- "xdotool" nil
- (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 ((vertico-count 100))
- (unwind-protect
+ (let ((vertico-count 100))
+ (unwind-protect
(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")))
+ (let* ((choice (completing-read "Choose an action: "
+ '("AUTO" "COPY PASS" "COPY USERNAME" "EDIT" "GENERATE")))
(action (pcase choice
- ("AUTO" #'pass-autotype)
+ ("AUTO" #'(lambda (entry)
+ (let ((user (password-store-get-field entry "user"))
+ (pass (password-store-get entry)))
+ (start-process-shell-command
+ "xdotool" nil
+ (format "sleep 0.3 && xdotool getactivewindow type '%s' && xdotool getactivewindow key Tab && xdotool getactivewindow type '%s'"
+ (if user user 'thanosapollo22) pass)))))
("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)))))))
+ (delete-frame))))))
(defun smtp-get-pass ()
"Get password for smtp."