Last active
November 17, 2024 10:09
-
-
Save istarkov/68075cf400cbd841101bc71b41f557a3 to your computer and use it in GitHub Desktop.
.zshrc pass function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pass() { | |
local input | |
read -r input | |
print -n "\e[1A\e[K" | |
local var=$(echo $input | sed 'y/[!"№%:,.;йцукенгшщзхъёфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪЁФЫВАПРОЛДЖЭЯЧСМИТЬБЮ/~!@#$%^&*qwertyuiop[]\\asdfghjkl;\''zxcvbnm,.QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>/') | |
echo -n "$var" | |
read -k 1 input | |
print -n "\e[1A\e[K" | |
if [[ $input == $'\n' ]]; then | |
echo -n "$var" | pbcopy | |
echo "Copied to clipboard, you have 15 seconds to paste it" | |
({ sleep 15; echo '***' | pbcopy } &) | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment