From 1c80f5bd735ea3c1a0c874bd096f080214027324 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Thu, 29 Aug 2019 19:47:55 -0500 Subject: [PATCH] dmenu_bw: Type password instead of copying it Auto-typing the password, instead of copying it to the clipboard, is more secure, since any process can read the contents of the clipboard. It is also significantly more convenient, avoiding the paste step, and works in situations where pasting isn't possible (such as into a VM console). --- dmenu_bw | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) mode change 100644 => 100755 dmenu_bw diff --git a/dmenu_bw b/dmenu_bw old mode 100644 new mode 100755 index 993cbd1..6deaabd --- a/dmenu_bw +++ b/dmenu_bw @@ -5,8 +5,5 @@ set -e key="$(bwpass | dmenu)" [ -n "${key}" ] || exit 0 -password="$(bwpass show "${key}")" -[ -n "${password}" ] || exit 1 -printf '%s' "${password}" | xclip -quiet -rmlastnl -sel clip 2> /dev/null & -sleep 12 -kill $! +bwpass show "${key}" | tr -d '\n' | xdotool type --file - +xdotool key Return