dotfiles/.config/wm_scripts/passrofi
2021-12-28 21:41:48 +08:00

16 lines
386 B
Bash
Executable File

#!/usr/bin/env bash
shopt -s nullglob globstar
dmenu="rofi"
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[@]}" | "$dmenu" -dmenu "$@")
[[ -n $password ]] || exit
pass show -c "$password" 2>/dev/null