diff options
Diffstat (limited to '.config/init')
-rw-r--r-- | .config/init/funcreqs/rpass | 2 | ||||
-rwxr-xr-x | .config/init/funcs/rpass | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/.config/init/funcreqs/rpass b/.config/init/funcreqs/rpass new file mode 100644 index 0000000..b689615 --- /dev/null +++ b/.config/init/funcreqs/rpass @@ -0,0 +1,2 @@ +func_init_prereqs=(xclip) +func_init_checks=("stat /dev/random") diff --git a/.config/init/funcs/rpass b/.config/init/funcs/rpass new file mode 100755 index 0000000..9cfbc84 --- /dev/null +++ b/.config/init/funcs/rpass @@ -0,0 +1,10 @@ +#!/usr/bin/env zsh +# generate random passwords + +unsetopt MULTIBYTE + +{ + cat /dev/random | while read -u0 -k1 c; do + [[ $c =~ '^[a-zA-Z0-9]$' ]] && printf $c + done | head -c 24 && printf "\n" +} | tee >(xclip -i -selection primary) | xclip -i -selection clipboard |