m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/contrib/dmenu/passmenu
blob: 5d9d4540ac9abfc9fc1e699caa2a03ab47ed89eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/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[@]}" | dmenu "$@")

[ $? -eq 0 ] && pass -c "$password"