summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2025-03-08 18:24:48 -0500
committerKjetil Orbekk <kj@orbekk.com>2025-03-08 18:25:11 -0500
commitd005ba3401241d0134ed67666835ea4d6493c96b (patch)
tree7ad7de3fd22fca0a13810056687b6ee8d42a2e83 /emacs
parentc705bfdb039d22f26dea76230eae9904e7082133 (diff)
Expand pass command
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.config/emacs/init.el20
1 files changed, 14 insertions, 6 deletions
diff --git a/emacs/.config/emacs/init.el b/emacs/.config/emacs/init.el
index 2089701..3fee400 100644
--- a/emacs/.config/emacs/init.el
+++ b/emacs/.config/emacs/init.el
@@ -547,16 +547,23 @@
(with-editor
(kj/pass-process "pass" "edit" password))))
-(keymap-global-set "C-c p" #'kj/pass)
-
-(defun kj/transient-command (&optional args)
+(defun kj/pass-generate (&optional args)
(interactive
- (list (transient-args 'kj/transient)))
- (message "args: %s" args))
+ (list (transient-args 'kj/pass-generate-transient)))
+ (let ((password (completing-read "Password name: " (kj/list-passwords) nil nil)))
+ (apply #'kj/pass-process "pass" "generate" `(,@args ,password))))
+
+(keymap-global-set "C-c p" #'kj/pass)
(use-package transient :ensure nil
:defer 1
:init
+ (transient-define-prefix kj/pass-generate-transient ()
+ "Generate"
+ [("-n" "No symbols" "--no-symbols")
+ ("-c" "Clipboard" "--clip")]
+ [""
+ ("g" "generate" kj/pass-generate)])
(transient-define-prefix
kj/transient ()
"KJ Transient"
@@ -568,7 +575,8 @@
["Pass"
("c" "Clipboard" kj/pass-to-clipboard)
("s" "Show" kj/pass-show)
- ("e" "Edit" kj/pass-edit)]
+ ("e" "Edit" kj/pass-edit)
+ ("g" "Generate" kj/pass-generate-transient)]
["Repositories"
("l" "List Repositories" magit-list-repositories)
("C" "Clone my project" kj/clone-project)]))