Even cleaner way of generating passwords

This commit is contained in:
krisdoodle45 2021-09-28 12:39:08 +02:00 committed by GitHub
parent 10a1da670e
commit 92336ad746
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,7 @@ addPassword() { \
[ -z "$name" ] && exit
case "$(printf "Random password\\nManual password" | dmenu -i -p "Passwords")" in
"Random password") addPass=$(tr -dc '\40-\176' < /dev/urandom | tr -d ' ' | head -c $(printf "12\\n32\\n128" | dmenu -i -p "How many characters?") ; echo '') ;;
"Random password") addPass=$(tr -dc '[:print:]' < /dev/urandom | tr -d ' ' | head -c $(printf "12\\n32\\n128" | dmenu -i -p "How many characters?")) ;;
"Manual password") addPass=$(dmenu -i -P -p "Enter a password") ;;
* ) exit
esac