Skip to content

Instantly share code, notes, and snippets.

@FATESAIKOU
Last active August 31, 2024 07:09
Show Gist options
  • Select an option

  • Save FATESAIKOU/7055be98887a2ab2d9b0235c0a38e6a7 to your computer and use it in GitHub Desktop.

Select an option

Save FATESAIKOU/7055be98887a2ab2d9b0235c0a38e6a7 to your computer and use it in GitHub Desktop.
an useless little fancy script
#!/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