Tip
for ansicolor, either using \033[XXm
directly, or use following c()
function as below:
# credit: https://github.com/ppo/bash-colors # author: @ppo # shellcheck disable=SC2015,SC2059 c() { [ $# == 0 ] && printf "\e[0m" || printf "$1" | sed 's/\(.\)/\1;/g;s/\([SDIUFNHT]\)/2\1/g;s/\([KRGYBMCW]\)/3\1/g;s/\([krgybmcw]\)/4\1/g;y/SDIUFNHTsdiufnhtKRGYBMCWkrgybmcw/12345789123457890123456701234567/;s/^\(.*\);$/\\e[\1m/g'; }
local spinner=( '⠁' '⠂' '⠄' '⡀' '⢀' '⠠' '⠐' '⠈' )
local spinner=( '⣄' '⣆' '⡇' '⠏' '⠋' '⠹' '⢸' '⣰' '⣠' )
local spinner=(
"$(c Rs)⣄$(c)"
"$(c Ys)⣆$(c)"
"$(c Gs)⡇$(c)"
"$(c Bs)⠏$(c)"
"$(c Ms)⠋$(c)"
"$(c Ys)⠹$(c)"
"$(c Gs)⢸$(c)"
"$(c Bs)⣰$(c)"
"$(c Ms)⣠$(c)"
)
local spinner=( '⣾' '⣽' '⣻' '⢿' '⡿' '⣟' '⣯' '⣷' '⣿' )
local spinner=(
"$(c Rs)⣾$(c)"
"$(c Ys)⣽$(c)"
"$(c Gs)⣻$(c)"
"$(c Cs)⢿$(c)"
"$(c Rs)⡿$(c)"
"$(c Ys)⣟$(c)"
"$(c Gs)⣯$(c)"
"$(c Cs)⣷$(c)"
)
local spinner=(
"∙∙∙∙∙"
"$(c Ys)●$(c)∙∙∙∙" # yellow
"∙$(c Gs)●$(c)∙∙∙" # green
"∙∙$(c Cs)●$(c)∙∙" # cyan
"∙∙∙$(c Bs)●$(c)∙" # blue
"∙∙∙∙$(c Ms)●$(c)" # magenta
)
local spinner=(
"$(c Rs)∙∙∙∙∙$(c)" # red
"$(c Ys)●∙∙∙∙$(c)" # yellow
"$(c Gs)∙●∙∙∙$(c)" # green
"$(c Cs)∙∙●∙∙$(c)" # cyan
"$(c Bs)∙∙∙●∙$(c)" # blue
"$(c Ms)∙∙∙∙●$(c)" # magenta
)
local spinner=( '∙∙∙∙∙' '●∙∙∙∙' '∙●∙∙∙' '∙∙●∙∙' '∙∙∙●∙' '∙∙∙∙●' )