diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2022-05-22 01:59:59 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2022-05-22 02:04:29 +1200 |
commit | 5c6f4344543688d927f32d73301b9656a518de8d (patch) | |
tree | 4f7956b972c4825fbbe00d51068525e86e03f8f2 | |
parent | Merge branch 'release/v12.6.0' into develop (diff) | |
download | dotfiles-5c6f4344543688d927f32d73301b9656a518de8d.tar.gz dotfiles-5c6f4344543688d927f32d73301b9656a518de8d.zip |
Change dmenu_pass to type not copy the password
Should be more secure.
-rwxr-xr-x[-rw-r--r--] | bin/dmenu_pass.sh | 9 | ||||
-rw-r--r-- | man/man1/dmenu_pass.1df | 10 |
2 files changed, 11 insertions, 8 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" diff --git a/man/man1/dmenu_pass.1df b/man/man1/dmenu_pass.1df index 51c32adb..c83cd837 100644 --- a/man/man1/dmenu_pass.1df +++ b/man/man1/dmenu_pass.1df @@ -1,17 +1,17 @@ .TH DMENU_PASS 1df "May 2022" "Manual page for dmenu_pass" .SH NAME .B dmenu_pass -\- pick a pass(1) password with dmenu(1) +\- pick and type a password-store password .SH SYNOPSIS .B dmenu_pass .SH DESCRIPTION .B dmenu_pass -applies dmenu(1) to pick a password entry from a pass(1) store and put it into -the X CLIPBOARD using the "show" command. +applies dmenu(1) to pick a password entry from a pass(1) store and types it out +with xdotool(1). .P A notification with the default priority is sent when the password is -successfully clipped. +successfully typed. .SH SEE ALSO -dmenu(1), notify-send(1), pass(1) +dmenu(1), notify-send(1), pass(1), xdotool(1) .SH AUTHOR Tom Ryder <tom@sanctum.geek.nz> |