Skip to content

Instantly share code, notes, and snippets.

@cig0
Created August 11, 2021 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cig0/dac3c0a7ddfebf70198026670256652b to your computer and use it in GitHub Desktop.
Save cig0/dac3c0a7ddfebf70198026670256652b to your computer and use it in GitHub Desktop.
Braile spinner for shell scripts -- Taken from https://github.com/pacstall/pacstall/issues/68
#!/bin/bash
# Copyright Notice:
# This spinner script has been taken from
# https://github.com/pacstall/pacstall/issues/68
spin()
{
spinners=(⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏)
msg=$1
fg="\e[34m"
reset_color="\e[0m"
# hide cursor
tput civis
while true
do
for spinner in "${spinners[@]}"
do
sleep 0.05
printf " $fg$spinner$reset_color \e[1m$msg\r" 2>/dev/null
done
done
# show cursor
tput cnorm || true
}
spin "Updating something"
@cig0
Copy link
Author

cig0 commented Aug 11, 2021

F/LOSS FTW!

Some of us never forget, Microsh*t: https://www.theregister.com/2019/06/27/microsoft_linux_distro_list/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment