ccr/consult-pass
This commit is contained in:
parent
122a0b4e70
commit
00170bfef8
1 changed files with 10 additions and 1 deletions
11
init.el
11
init.el
|
@ -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))
|
||||||
|
|
Reference in a new issue