Skip to content

Instantly share code, notes, and snippets.

@ralt
Created Nov 24, 2017
Embed
What would you like to do?
StumpWM integration with password store, aka "pass"
(defun pass-entries ()
(let* ((home (merge-pathnames #p".password-store/" (user-homedir-pathname)))
(home-ns-len (length (namestring home))))
(mapcar
(lambda (entry)
(let ((entry-ns (namestring entry)))
(subseq entry-ns home-ns-len (- (length entry-ns) 4))))
(directory (make-pathname :directory `(,@(pathname-directory home)
:wild-inferiors)
:name :wild
:type "gpg")))))
(defcommand pass-into-clipboard () ()
"Put a password into the clipboard."
(let ((entry (completing-read (current-screen)
"entry: "
(pass-entries))))
(run-shell-command (format nil "pass -c ~a" entry))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment