flocon/dot_scripts/executable_passwmenu

16 lines
351 B
Text
Raw Normal View History

2023-09-20 16:16:15 +00:00
#!/bin/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}" )
password=$(printf '%s\n' "${password_files[@]}" | wofi --dmenu "$@")
[[ -n $password ]] || exit
pass show "$password" -c