dotfiles

Cross platform dotfiles for linux, mac and windows

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
#!/bin/sh

# reliable password fuzzy searcher

: ${PASSWORD_STORE_DIR?"Error var not set"}
cd "${PASSWORD_STORE_DIR}" || exit 1

PASSTOOL=spm
type ${PASSTOOL} 2>/dev/null || PASSTOOL=pass

selection="$(find -L . -name '*.gpg' | sed 's/.gpg$//g' | ${FUZZER})"

test -z "${selection}" || {
	case ${selection} in
        *totp/*) pass ${1:-"otp"} "${selection}" ;;
        ?*)pass ${1:-"show"} "${selection}" ;;
	esac
}