Created
May 10, 2016 08:00
-
-
Save projectivemotion/41d7d463180b0fd03158e84cd8975ce0 to your computer and use it in GitHub Desktop.
Flash Terminal Color, Blink Terminal Colors
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
#!/bin/bash | |
# | |
# Author: Amado Martinez - AmadoMartinez.mx | |
# License: MIT License | |
# Date: 2016-05-10 | |
# | |
# Keywords: Flash Terminal Color Shell Color Blink Alert | |
# | |
if [ $# -lt 2 ] ; then | |
head -n 10 $0 | grep ^# | |
echo -e "Usage:\n\t$0 [speed] [times] [color1] [color2]\nExample:\n\t$0 0.5 3 red white\n" | |
exit | |
fi | |
if [ $# -lt 4 ] ; then | |
fore=black | |
back=white | |
else | |
fore=$3 | |
back=$4 | |
fi | |
function flip(){ | |
setterm -term linux -back $1 -fore $2 -clear all | |
} | |
for i in $(seq 1 $2); do | |
flip $back $fore | |
sleep $1 | |
flip $fore $back | |
sleep $1 | |
done | |
setterm -default -clear all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment