commit 8486079c4060d259eefd23b01342b6b0b42bf149
parent d5aae23753d6567e53ab612c14c55bc48ebe3fb0
Author: Wim Dupont <wim@wimdupont.com>
Date: Sat, 13 Aug 2022 17:59:37 +0200
updated pass autotype
Diffstat:
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/bin/otp b/bin/otp
@@ -8,6 +8,7 @@ typeit=0
if [[ $1 == "--type" ]]; then
typeit=1
+ value=
shift
fi
@@ -62,5 +63,5 @@ password=$(printf '%s\n' "${password_files[@]}" | "$dmenu" -fn "$font" -i "$@")
if [[ $typeit -eq 0 ]]; then
pass otp -c "$password" 2>/dev/null
else
- pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | $xdotool
+ pass otp "$password" | { IFS= read -r pass; printf %s "$pass"; } | $xdotool
fi
diff --git a/bin/pwu b/bin/pwu
@@ -9,6 +9,7 @@ typeit=0
if [[ $1 == "--type" ]]; then
typeit=1
+ value=
shift
fi
@@ -121,5 +122,11 @@ if [[ $typeit -eq 0 ]]; then
use_otp "$password"
fi
else
- pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | $xdotool
+ selection=$(pass show "$password")
+ if [[ -z "$selection" ]]; then
+ exit
+ fi
+ echo "$selection" | sed -n 2p | { IFS= read -r pass; printf %s "$pass"; } | $xdotool
+ xdotool key Tab
+ echo "$selection" | sed -n 1p | { IFS= read -r pass; printf %s "$pass"; } | $xdotool
fi