mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Better random passwords
This commit is contained in:
parent
92336ad746
commit
8f28de8865
@ -52,7 +52,7 @@ addPassword() { \
|
|||||||
[ -z "$name" ] && exit
|
[ -z "$name" ] && exit
|
||||||
|
|
||||||
case "$(printf "Random password\\nManual password" | dmenu -i -p "Passwords")" in
|
case "$(printf "Random password\\nManual password" | dmenu -i -p "Passwords")" in
|
||||||
"Random password") addPass=$(tr -dc '[:print:]' < /dev/urandom | tr -d ' ' | head -c $(printf "12\\n32\\n128" | dmenu -i -p "How many characters?")) ;;
|
"Random password") addPass=$(tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' </dev/urandom | head -c $(printf "12\\n32\\n128" | dmenu -i -p "How many characters?") ; echo) ;;
|
||||||
"Manual password") addPass=$(dmenu -i -P -p "Enter a password") ;;
|
"Manual password") addPass=$(dmenu -i -P -p "Enter a password") ;;
|
||||||
* ) exit
|
* ) exit
|
||||||
esac
|
esac
|
||||||
@ -64,15 +64,15 @@ addPassword() { \
|
|||||||
}
|
}
|
||||||
|
|
||||||
removePassword() { \
|
removePassword() { \
|
||||||
name="$(pass | printf '%s\n' "${password_files[@]}" | dmenu -i -p "Passwords")"
|
name="$(pass | echo "$password_files" | dmenu -i -p "Passwords")"
|
||||||
|
|
||||||
[ -z "$name" ] && exit
|
[ -z "$name" ] && exit
|
||||||
|
|
||||||
sure="$(printf "No\\nYes" | dmenu -i -sb "#ac3333" -sf "#111111" -nf "#dddddd" -nb "#111111" -p "Are you sure?")"
|
sure="$(printf "No\\nYes" | dmenu -i -sb "#ac3333" -sf "#111111" -nf "#dddddd" -nb "#111111" -p "Are you sure?")"
|
||||||
if [ $sure = "Yes" ]
|
if [ $sure = "Yes" ]
|
||||||
then
|
then
|
||||||
notify-send "❎ Password for $name removed!"
|
|
||||||
pass rm "$name" -f
|
pass rm "$name" -f
|
||||||
|
notify-send "❎ Password for $name removed!"
|
||||||
else
|
else
|
||||||
notify-send "Canceled"
|
notify-send "Canceled"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user