1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-12-24 17:28:13 +00:00
dotfiles/scripts/.bin/passmenu

20 lines
385 B
Plaintext
Raw Normal View History

2014-06-26 16:07:56 +00:00
#!/bin/bash
shopt -s nullglob globstar
2016-01-07 11:53:04 +00:00
if command -v rofi >/dev/null 2>&1;
then
program="rofi -dmenu"
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"