1
0
dotfiles/dot_config/zsh/ragequit.zsh

28 lines
834 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env zsh
function flip() {
perl -C3 -Mutf8 -lpe '$_=reverse;y/a-zA-Z.['\'',({?!\"<_;‿⁅∴\r/ɐqɔpǝɟƃɥıɾʞ|ɯuodbɹsʇnʌʍxʎzɐqɔpǝɟƃɥıɾʞ|ɯuodbɹsʇnʌʍxʎz˙],'\'')}¿¡,>‾؛⁀⁆∵\n/' <<< "$1"
}
function fuck() {
CMD="pkill"
which $CMD >/dev/null || CMD="killall"
echo
if [ "$1" "==" "off" ]; then
shift
FLIP=(' (ノಠ益ಠ)ノ彡' '(ノಠ-ಠ)ノ彡')
SIG="-9"
else
[ "$1" "==" "you" ] && shift
FLIP=(' (╯°□°)╯︵' '( ゜Д゜) ︵' '(ノಥДಥ)ノ︵' ' ヽ(`Д´)ノ︵' ' (ノಥ益ಥ)ノ ')
SIG=""
fi
[ -z "$1" ] && { echo "┬─┬ ( ゜-゜ノ) patience young grasshopper"; echo; return; }
F=${FLIP[$RANDOM % ${#FLIP[@]} ]}
if $CMD $SIG "$1"; then
echo "$F$(flip $1)"; echo
else
echo "┬─┬ ︵ /(.□. \"; echo
fi
}