From 36794b4d6a8fc2b92861c89ce0146052d46d5473 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Tue, 21 Apr 2020 23:34:28 -0400 Subject: [PATCH] Adding pass support. --- emacs/doom.d/init.el | 2 +- zsh/modules/bin/fzf-pass | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100755 zsh/modules/bin/fzf-pass diff --git a/emacs/doom.d/init.el b/emacs/doom.d/init.el index 6169b97..1a628aa 100644 --- a/emacs/doom.d/init.el +++ b/emacs/doom.d/init.el @@ -101,7 +101,7 @@ ;;macos ; MacOS-specific commands magit ; a git porcelain for Emacs make ; run make tasks from Emacs - ;;pass ; password manager for nerds + pass ; password manager for nerds ;;pdf ; pdf enhancements ;;prodigy ; FIXME managing external services & code builders ;;rgb ; creating color strings diff --git a/zsh/modules/bin/fzf-pass b/zsh/modules/bin/fzf-pass new file mode 100755 index 0000000..749f389 --- /dev/null +++ b/zsh/modules/bin/fzf-pass @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +cd "$HOME/.password-store" || exit 1 +PASSFILE=$(tree -Ffi | grep '.gpg' | sed 's/.gpg$//g' | sed 's/^..//' | fzf) + +if [ -z "$PASSFILE" ]; then + exit 0 +fi + +PASSDATA="$(pass "$PASSFILE")" +USRNAME="$(echo "$PASSDATA" | grep "username:" | cut -d' ' -f2-)" +PASS="$(echo "$PASSDATA" | head -n 1)" +URL="$(echo "$PASSDATA" | grep url: | cut -d' ' -f2-)" + +RESP=$(cat <