Skip to content

Instantly share code, notes, and snippets.

@SharkyRawr
Created July 26, 2019 12:21
Show Gist options
  • Save SharkyRawr/04204a3f4ec83709e638685d69224b5b to your computer and use it in GitHub Desktop.
Save SharkyRawr/04204a3f4ec83709e638685d69224b5b to your computer and use it in GitHub Desktop.
#! /bin/sh
# By Sharky - https://sharky.pw/
COLS=`tput cols`
ROWS=`tput lines`
OWOS=(
"OwO" "ØwØ" "◕w◕" "◔w◔" "ʘwʘ" "𝕆𝕨𝕆" "σωσ" "𝙊𝙬𝙊" "(。O ω O。)"
"UwU" "🆄🆆🆄" "ⓤⓦⓤ" "𝖴𝗐𝖴" "𝓤𝔀𝓤" "( ᴜ ω ᴜ )"
)
SLEEPTIME=0.2
function put_owo {
# get random cursor position in terminal
MAXW=$COLS-5
MAXH=$ROWS-1
X=$(( ($RANDOM % $MAXW) +1 ))
Y=$(( ($RANDOM % $MAXH) +1 ))
# get random owo
OWO=${OWOS[(($RANDOM % (${#OWOS[@]})))]}
echo -e "\033[${Y};${X}H${OWO}"
# Put cursor in far corners as to not be visible
#echo -ne "\033[${COLS};${ROWS-1}H"
}
function clearscreen {
echo -e "\033[2J"
}
clearscreen
if [[ ! -z "$1" && ! "$1" =~ '^[0-9]+([.][0-9]+)?$' ]]; then
# first argument is a number
SLEEPTIME=$1
fi
while [ 1 ]; do
put_owo
sleep $SLEEPTIME
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment