Skip to content

Instantly share code, notes, and snippets.

@cig0
Created August 11, 2021 21:48
Show Gist options
  • 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