2014-06-26 16:07:56 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
shopt -s nullglob globstar
|
|
|
|
|
2016-01-07 11:53:04 +00:00
|
|
|
|
2020-12-28 15:21:25 +00:00
|
|
|
if command -v myrofi >/dev/null 2>&1;
|
2016-01-07 11:53:04 +00:00
|
|
|
then
|
2020-12-28 15:21:25 +00:00
|
|
|
program="myrofi -no-show-icons -dmenu"
|
2016-01-07 11:53:04 +00:00
|
|
|
else
|
|
|
|
program="dmenu"
|
|
|
|
fi
|
|
|
|
|
2014-06-26 16:07:56 +00:00
|
|
|
password_files=( ~/.password-store/**/*.gpg )
|
|
|
|
password_files=( "${password_files[@]##*/.password-store/}" )
|
|
|
|
password_files=( "${password_files[@]%.gpg}" )
|
|
|
|
|
2016-01-07 11:53:04 +00:00
|
|
|
password=$(printf '%s\n' "${password_files[@]}" | $program "$@")
|
2014-06-26 16:07:56 +00:00
|
|
|
|
2015-03-10 16:30:06 +00:00
|
|
|
pass show -c "$password"
|