Skip to content

Instantly share code, notes, and snippets.

@victorfsf
Created November 19, 2017 21:20
Show Gist options
  • Save victorfsf/a4f1dcfc6ea7256cf7e73bcae2324caa to your computer and use it in GitHub Desktop.
Save victorfsf/a4f1dcfc6ea7256cf7e73bcae2324caa to your computer and use it in GitHub Desktop.
#!/usr/bin/env zsh
sleep 10 &!
pid=$! # Process Id of the previous running command
spin='⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓'
i=0
while kill -0 $pid 2>/dev/null; do
i=$(((i + 1) % 10))
printf "$fg[magenta]\r${spin:$i:1}"
printf "$fg[white] Waiting..."
sleep .1
done
printf "\r$fg[green]✓\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment