From 2dd2e92180b146982611bce51bd645524a6a0208 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Fri, 19 Mar 2021 09:34:17 -0500 Subject: Add different styles of spinners. --- spinner.sh | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/spinner.sh b/spinner.sh index 7a2c874..525bd9f 100644 --- a/spinner.sh +++ b/spinner.sh @@ -10,10 +10,32 @@ spinner() { tput civis # hide cursor printf "${WHT}" while [ -d /proc/$PROC ]; do - printf '\033[s\033[u[ / ] %s\033[u' "$str"; sleep "$delay" - printf '\033[s\033[u[ — ] %s\033[u' "$str"; sleep "$delay" - printf '\033[s\033[u[ \ ] %s\033[u' "$str"; sleep "$delay" - printf '\033[s\033[u[ | ] %s\033[u' "$str"; sleep "$delay" + #-\|/ + #⠁⠂⠄⡀⢀⠠⠐⠈ + #▁▂▃▄▅▆▇█▇▆▅▄▃▂▁ + #←↖↑↗→↘↓↙ + #▖▘▝▗ + #◢◣◤◥ + #┤┘┴└├┌┬┐ + #◰◳◲◱ + #◴◷◶◵ + #◐◓◑◒ + #⣾⣽⣻⢿⡿⣟⣯⣷ + printf '\033[s\033[u[ ▁ ] %s\033[u' "$str"; sleep "$delay" + printf '\033[s\033[u[ ▂ ] %s\033[u' "$str"; sleep "$delay" + printf '\033[s\033[u[ ▃ ] %s\033[u' "$str"; sleep "$delay" + printf '\033[s\033[u[ ▄ ] %s\033[u' "$str"; sleep "$delay" + printf '\033[s\033[u[ ▅ ] %s\033[u' "$str"; sleep "$delay" + printf '\033[s\033[u[ ▆ ] %s\033[u' "$str"; sleep "$delay" + printf '\033[s\033[u[ ▇ ] %s\033[u' "$str"; sleep "$delay" + printf '\033[s\033[u[ █ ] %s\033[u' "$str"; sleep "$delay" + printf '\033[s\033[u[ ▇ ] %s\033[u' "$str"; sleep "$delay" + printf '\033[s\033[u[ ▆ ] %s\033[u' "$str"; sleep "$delay" + printf '\033[s\033[u[ ▅ ] %s\033[u' "$str"; sleep "$delay" + printf '\033[s\033[u[ ▄ ] %s\033[u' "$str"; sleep "$delay" + printf '\033[s\033[u[ ▃ ] %s\033[u' "$str"; sleep "$delay" + printf '\033[s\033[u[ ▂ ] %s\033[u' "$str"; sleep "$delay" + printf '\033[s\033[u[ ▁ ] %s\033[u' "$str"; sleep "$delay" done wait ${PROC} retval=$? -- cgit v1.2.3-54-g00ecf