From 960d8647437f7127a6de167b974b8f7aafc77130 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Thu, 19 Jan 2023 10:04:51 +0100 Subject: Added first few utilities --- bin/menu-pass | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 bin/menu-pass (limited to 'bin/menu-pass') diff --git a/bin/menu-pass b/bin/menu-pass new file mode 100755 index 0000000..74468d6 --- /dev/null +++ b/bin/menu-pass @@ -0,0 +1,24 @@ +#!/bin/sh +# +# Select which password from pass(1) to copy into the clipboard using an interactive menu +# +# Inspired by +# https://github.com/ibizaman/pass-clip/blob/9ef6e932e1149c07e991c82f916d018f3fbf0694/clip.bash + +PASSWORD_STORE_DIR="${PASSWORD_STORE_DIR:-$HOME/.password-store}" + +passfile=$(find -L "${PASSWORD_STORE_DIR}" \ + -path '*/.git' \ + -prune \ + -o \ + -iname '*.gpg' \ + -printf '%P\n' \ + | sed -e 's/.gpg$//' \ + | bemenu -i -s -c -l 20 -W 0.2 -p '*') + +if [ -z $passfile ] +then + exit 1 +else + pass show -c $passfile +fi -- cgit v1.2.3