Yet another terminal spinner written in Bash. Customizable and pretty 💄
Simple. First download spinny:
wget https://raw.githubusercontent.com/hschne/spinny/master/spinny.sh
To use it in your shell scripts import it, and you are good to go:
source spinny.sh
printf "Starting some long running process now... "
spinny::start
sleep 3
spinny::stop
printf "Done!\n"
Spinny is versatile and can animate pretty much anything you throw at it. The variables SPINNY_FRAMES
and SPINNY_DELAY
can be used to change the look of the spinner. The code below will render three dots instead:
SPINNY_FRAMES=(. .. ...)
SPINNY_DELAY=0.1
printf "Fancy spinners right here: "
spinny::start
sleep 3
spinny::stop
printf " \n"
Have a look at the demo for more examples or run it yourself:
chmod +x demo.sh && ./demo.sh
I'm new to this entire bash thing. While I try and keep things portable and dependencies to a minimum, I can't guarantee that Spinny will work on your particular machine.
If you encounter any errors or have ideas for improvements feel free to file an issue! ❤️