Created
November 24, 2017 21:51
-
-
Save ralt/6ebf2d3bbd37226a0ed05f9390014071 to your computer and use it in GitHub Desktop.
StumpWM integration with password store, aka "pass"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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