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).
This commit is contained in:
7
dmenu_bw
Normal file → Executable file
7
dmenu_bw
Normal file → Executable file
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user