Archived
1
0
Fork 0
This repository has been archived on 2024-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/simpleDots/bin/p

15 lines
378 B
Text
Raw Normal View History

2022-02-18 00:28:49 +01:00
#!/bin/bash
## A wrapper for pass to use fzf to find passwords.
prefix=${PASSWORD_STORE_DIR-~/.password-store}
password_files=( "$prefix"/**/*.gpg )
password_files=( "${password_files[@]#"$prefix"/}" )
password_files=( "${password_files[@]%.gpg}" )
password=$(printf '%s\n' "${password_files[@]}" | fzf "$@")
[[ -n $password ]] || exit
pass show -c "$password" 2>/dev/null