Skip to content

Instantly share code, notes, and snippets.

@ralt
Created November 24, 2017 21:51
Show Gist options
  • Save ralt/6ebf2d3bbd37226a0ed05f9390014071 to your computer and use it in GitHub Desktop.
Save ralt/6ebf2d3bbd37226a0ed05f9390014071 to your computer and use it in GitHub Desktop.
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