Skip to content

Commit

Permalink
Separate pass settings
Browse files Browse the repository at this point in the history
  • Loading branch information
chuxubank committed Dec 12, 2023
1 parent b1d00a9 commit 7ef4989
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
https://github.com/rime/home/wiki/UserGuide#同步用戶資料

** Pass
https://www.masteringemacs.org/article/keeping-secrets-in-emacs-gnupg-auth-sources
~$HOME/.gnupg/gpg-agent.conf~
#+begin_example
allow-emacs-pinentry
Expand Down
6 changes: 6 additions & 0 deletions cats/+default.el
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,9 @@

;;; time
(setq timeclock-file (concat cat-etc-dir "timelog"))

;;; gpg
(use-package epg-config
:ensure nil
:custom
(epg-pinentry-mode 'loopback))
18 changes: 10 additions & 8 deletions cats/+pass.el
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
;; -*- lexical-binding: t; -*-

(use-package pass
(use-package pass)

(use-package password-store
:custom
(password-store-password-length 16)
(epg-pinentry-mode 'loopback))

(with-eval-after-load 'password-store
:config
(defun password-store-generate (entry &optional password-length)
"Generate a new password for ENTRY with PASSWORD-LENGTH.
Default PASSWORD-LENGTH is `password-store-password-length'."
(interactive (list (password-store--completing-read)
(when current-prefix-arg
(abs (prefix-numeric-value current-prefix-arg)))))
(unless password-length (setq password-length password-store-password-length))
;; A message with the output of the command is not printed because
;; the output contains the password.
;; A message with the output of the command is not printed
;; because the output contains the password.
;; Generate password in-place if entry file exists.
(password-store--run-generate entry password-length (if (file-exists-p (password-store--entry-to-file entry)) t nil))
(password-store--run-generate
entry
(or password-length password-store-password-length)
(if (file-exists-p (password-store--entry-to-file entry)) t nil))
nil)
(defun password-store--run-generate (entry password-length &optional in-place no-symbols)
(password-store--run "generate"
Expand Down

0 comments on commit 7ef4989

Please sign in to comment.