ccr/consult-pass

This commit is contained in:
Andrea Ciceri 2023-10-12 15:51:32 +02:00
parent 122a0b4e70
commit 00170bfef8
Signed by: aciceri
SSH key fingerprint: SHA256:/AagBweyV4Hlfg9u092n8hbHwD5fcB6A3qhDiDA65Rg

11
init.el
View file

@ -591,7 +591,16 @@
;; Wrapping this in order to merge histories from different shells ;; Wrapping this in order to merge histories from different shells
(advice-add 'eshell-write-history (advice-add 'eshell-write-history
:around #'ccr/wrap-eshell-write-history) :around #'ccr/wrap-eshell-write-history)
(defun ccr/consult-pass (&optional otp)
"Interactive search password"
(interactive)
(let* ((entries (password-store-list))
(fun (if otp 'password-store-otp-token-copy 'password-store-copy))
(prompt (if otp "Password: " "OTP: "))
(selected (completing-read prompt entries)))
(apply fun `(,selected))))
(add-to-list 'eshell-modules-list 'eshell-tramp) ;; to use sudo in eshell (add-to-list 'eshell-modules-list 'eshell-tramp) ;; to use sudo in eshell
;; :hook ((eshell-load . eat-eshell-mode) ;; :hook ((eshell-load . eat-eshell-mode)
;; (eshell-load . eat-eshell-visual-command-mode)) ;; (eshell-load . eat-eshell-visual-command-mode))