config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit b90807f323e0d304524314f9afcafa6d6e4acc5d
parent 9b78156dc0a7d3bf7be632e5fa3f87e6c63c6932
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Thu, 31 Dec 2020 02:03:44 -0800

Use spm(1) instaed of pass(1) in gp script

Spm does everything itself as far as searching goes, It (rightly)
lacks clipboard copying and so that's now what this script does.

Diffstat:
Mmodules/scripts/.local/bin/gp | 18+++---------------
1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/modules/scripts/.local/bin/gp b/modules/scripts/.local/bin/gp @@ -1,16 +1,4 @@ -#!/usr/bin/env dash -#! gp -- find and copy pass(1) passwords to the clipboard -#! -#! Every argument is passed egrep(1) therefor any argument egrep accepts -#! is valid. +#!/usr/local/bin/rc -e +#! gp -- copy spm(1) password to clipboard. -set -eu - -dir="${PASSWORD_STORE_DIR:-$HOME/.password-store}" -# errexit prevents no match -match="`find "$dir" -type f -name "*.gpg" | sed -E "s:^$dir/?(.*)\.gpg$:\1:g" | egrep $@`" - -echo "$match" -if [ `echo "$match" | wc -l` -eq 1 ]; then - pass -c "$match" -fi +spm show $* | xclip -selection clipboard -in