2019-05-19 00:03:15 -04:00
|
|
|
;;; tools/pass/config.el -*- lexical-binding: t; -*-
|
2017-06-11 02:26:51 +02:00
|
|
|
|
2017-06-11 18:01:03 +02:00
|
|
|
(defvar +pass-user-fields '("login" "user" "username" "email")
|
|
|
|
"A list of fields for `+pass/ivy' to search for the username.")
|
|
|
|
|
2017-06-12 02:38:16 +02:00
|
|
|
(defvar +pass-url-fields '("url" "site" "location")
|
|
|
|
"A list of fields for `+pass/ivy' to search for the username.")
|
|
|
|
|
2017-06-11 18:01:03 +02:00
|
|
|
|
|
|
|
;;
|
2018-09-07 19:36:16 -04:00
|
|
|
;; Packages
|
2017-06-11 18:01:03 +02:00
|
|
|
|
2018-05-25 00:46:11 +02:00
|
|
|
;; `password-store'
|
|
|
|
(setq password-store-password-length 12)
|
2017-06-11 02:26:51 +02:00
|
|
|
|
2018-05-29 17:50:55 +02:00
|
|
|
;; Fix hard-coded password-store location; respect PASSWORD_STORE_DIR envvar
|
2019-05-19 00:03:15 -04:00
|
|
|
(defun +pass*read-entry (entry)
|
2018-05-29 17:50:55 +02:00
|
|
|
"Return a string with the file content of ENTRY."
|
|
|
|
(with-temp-buffer
|
|
|
|
(insert-file-contents
|
|
|
|
(expand-file-name (format "%s.gpg" entry) (password-store-dir)))
|
|
|
|
(buffer-substring-no-properties (point-min) (point-max))))
|
2019-05-19 00:03:15 -04:00
|
|
|
(advice-add #'auth-source-pass--read-entry :override #'+pass*read-entry)
|
2018-05-29 17:50:55 +02:00
|
|
|
|
2017-06-11 02:26:51 +02:00
|
|
|
|
2018-05-25 00:46:11 +02:00
|
|
|
;; `pass'
|
2018-05-29 17:50:55 +02:00
|
|
|
(after! pass
|
2018-06-15 02:58:12 +02:00
|
|
|
(set-evil-initial-state! 'pass-mode 'emacs)
|
2018-06-18 02:26:05 +02:00
|
|
|
(set-popup-rule! "^\\*Password-Store" :side 'left :size 0.25 :quit nil)
|
2018-06-03 15:46:00 +02:00
|
|
|
(define-key! pass-mode-map
|
|
|
|
"j" #'pass-next-entry
|
|
|
|
"k" #'pass-prev-entry
|
|
|
|
"d" #'pass-kill
|
|
|
|
"\C-j" #'pass-next-directory
|
2018-06-23 20:00:03 +02:00
|
|
|
"\C-k" #'pass-prev-directory))
|
2017-06-11 16:40:57 +02:00
|
|
|
|
|
|
|
|
2017-07-29 00:00:19 +02:00
|
|
|
;; Is built into Emacs 26+
|
2018-05-25 00:46:11 +02:00
|
|
|
(when (and EMACS26+ (featurep! +auth))
|
|
|
|
(auth-source-pass-enable))
|