1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-11-14 16:52:29 +00:00
dotfiles/scripts/.bin/passmenu

20 lines
385 B
Plaintext
Raw Permalink 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"