Skip to content

Instantly share code, notes, and snippets.

@polypoyo
Created November 29, 2022 04:40
Show Gist options
  • Save polypoyo/d46fba879549e55ae8cfcca3fb773cb5 to your computer and use it in GitHub Desktop.
Save polypoyo/d46fba879549e55ae8cfcca3fb773cb5 to your computer and use it in GitHub Desktop.
stupid yourworldoftext gag
#!/usr/bin/env bash
sleep 1;
window=$(xdotool selectwindow)
width=${1:-25} # pass an argument to specify a width
text="SPLATOON" # don't touch
text="$text$text$text$text$text$text$text$text$text" # duplicate the string a few times
text="$text$text$text$text$text$text$text$text$text" # so we can truncate it to /longer/ lengths
text=$(echo $text | head -c$width) # that's exactly what we do here, "truncate" it to a longer length.
while true; do
echo "typing $width letters"
# type out our text. we do this really slowly since lag is super common on web browsers
xdotool type --window $window --delay 500 $text
# go to next line
xdotool key --window $window Return
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment