|
@@ -6,6 +6,11 @@ typeit=1
|
|
|
if [[ $1 == "--no-type" ]]; then
|
|
|
typeit=0
|
|
|
shift
|
|
|
+elif [[ $1 == "-n" ]] ; then
|
|
|
+ typeit=0
|
|
|
+ shift
|
|
|
+elif [[ $1 != "" ]] ; then
|
|
|
+ password=$1
|
|
|
fi
|
|
|
|
|
|
prefix=${PASSWORD_STORE_DIR-~/.password-store}
|
|
@@ -13,11 +18,13 @@ password_files=( "$prefix"/**/*.gpg )
|
|
|
password_files=( "${password_files[@]#"$prefix"/}" )
|
|
|
password_files=( "${password_files[@]%.gpg}" )
|
|
|
|
|
|
+if [[ $password == "" ]] ; then
|
|
|
if [[ -e `which rofi` ]] ; then
|
|
|
password=$(printf '%s\n' "${password_files[@]}" | rofi -dmenu -p 'password: ')
|
|
|
else
|
|
|
password=$(printf '%s\n' "${password_files[@]}" | dmenu -p 'password: ')
|
|
|
fi
|
|
|
+fi
|
|
|
|
|
|
[[ -n $password ]] || exit
|
|
|
|
|
@@ -25,5 +32,5 @@ if [[ $typeit -eq 0 ]]; then
|
|
|
pass show -c "$password" 2>/dev/null
|
|
|
else
|
|
|
pass show "$password" | { read -r pass; printf %s "$pass"; } |
|
|
|
- xdotool type --clearmodifiers --file -
|
|
|
+ xvkbd -xsendevent -file -
|
|
|
fi
|