Last active
August 31, 2024 07:09
-
-
Save FATESAIKOU/7055be98887a2ab2d9b0235c0a38e6a7 to your computer and use it in GitHub Desktop.
an useless little fancy script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| WINDOW_SIZE=$(tput cols) | |
| PREFIX_SIZE=$(echo -n -e "[$(date)]: $RANDOM\t" | expand | wc -m) | |
| SUFFIX_SIZE=$(echo -n -e "|" | wc -c) | |
| BAR_SIZE=$(( (WINDOW_SIZE - PREFIX_SIZE - SUFFIX_SIZE) / 2 )) | |
| while true; | |
| do | |
| randnum=$RANDOM; | |
| space=$(( randnum / 100 % (BAR_SIZE + 1) )); | |
| echo -n -e "[$(date)]: $randnum\t"; | |
| echo $( | |
| for ((i=0; i<space; i++)); | |
| do | |
| echo -n "◽️"; | |
| done | |
| )$( | |
| for ((i=space+1; i<=BAR_SIZE; i++)); | |
| do | |
| echo -n " "; | |
| done | |
| )"|"; | |
| sleep 0.02; | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment