diff options
author | katherine <ageha@airen-no-jikken.icu> | 2020-09-09 10:03:57 -0700 |
---|---|---|
committer | katherine <ageha@airen-no-jikken.icu> | 2020-09-09 10:03:57 -0700 |
commit | bb88edcb0cbc6d10cadd37bde6833e79c7cab531 (patch) | |
tree | f505e8cf60e0b7073c0af2a7628e06d03d41464b /.config/init/funcs | |
parent | d74f49bb93b14d0cfe18f76ba6e02716bc883c5a (diff) | |
download | dotfiles-bb88edcb0cbc6d10cadd37bde6833e79c7cab531.tar.gz |
add rpass func
Diffstat (limited to '.config/init/funcs')
-rwxr-xr-x | .config/init/funcs/rpass | 10 |
1 files changed, 10 insertions, 0 deletions
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 |