aboutsummaryrefslogtreecommitdiff
path: root/bin/dmenu_pass.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/dmenu_pass.sh')
-rwxr-xr-x[-rw-r--r--]bin/dmenu_pass.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/dmenu_pass.sh b/bin/dmenu_pass.sh
index bfb687b1..44296439 100644..100755
--- a/bin/dmenu_pass.sh
+++ b/bin/dmenu_pass.sh
@@ -1,4 +1,4 @@
-# Pick a pass(1) password with dmenu(1)
+# Pick and type out a pass(1) password with dmenu(1) and xdotool(1)
self=dmenu_pass
cd -- "${PASSWORD_STORE_DIR:-"$HOME"/.password-store}" || exit
# shellcheck disable=SC2016
@@ -8,7 +8,10 @@ name=$(
LC_ALL=C sort -f |
dmenu
)
-pass show --clip -- "$name" || exit
+password=$(pass show -- "$name" | head -n 1) || exit
+[ -n "$password" ] || exit
+printf %s "$password" | xdotool type --clearmodifiers --file - \
+ || exit
notify-send --app-name="$self" -- \
- "Password saved to CLIPBOARD" \
+ "Password typed" \
"$name"