2021-12-28 21:38:34 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
shopt -s nullglob globstar
|
|
|
|
|
|
|
|
prefix=${PASSWORD_STORE_DIR-~/.password-store}
|
|
|
|
password_files=( "$prefix"/**/*.gpg )
|
|
|
|
password_files=( "${password_files[@]#"$prefix"/}" )
|
|
|
|
password_files=( "${password_files[@]%.gpg}" )
|
|
|
|
|
2022-01-24 05:11:35 +08:00
|
|
|
password=$(printf '%s\n' "${password_files[@]}" | "$HOME/.config/wm_scripts/menucmd" "$@")
|
2021-12-28 21:38:34 +08:00
|
|
|
|
|
|
|
[[ -n $password ]] || exit
|
|
|
|
|
|
|
|
pass show -c "$password" 2>/dev/null
|