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 /bin | |
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.
Diffstat (limited to 'bin')
-rwxr-xr-x[-rw-r--r--] | bin/dmenu_pass.sh | 9 |
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" |