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).master
parent
ff8414a888
commit
1c80f5bd73
|
@ -5,8 +5,5 @@ set -e
|
||||||
|
|
||||||
key="$(bwpass | dmenu)"
|
key="$(bwpass | dmenu)"
|
||||||
[ -n "${key}" ] || exit 0
|
[ -n "${key}" ] || exit 0
|
||||||
password="$(bwpass show "${key}")"
|
bwpass show "${key}" | tr -d '\n' | xdotool type --file -
|
||||||
[ -n "${password}" ] || exit 1
|
xdotool key Return
|
||||||
printf '%s' "${password}" | xclip -quiet -rmlastnl -sel clip 2> /dev/null &
|
|
||||||
sleep 12
|
|
||||||
kill $!
|
|
||||||
|
|
Reference in New Issue