Skip to content

Sweeping Lines Terminal Screensaver

License

Notifications You must be signed in to change notification settings

lbgists/sweeplines.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation


                      Sweeping Lines Terminal Screensaver


sweeplines.sh is just a simple Bash script I whipped up in about an hour, 
trying to imitate the screensaver that has colorful lines sweep and bounce 
within screen.

It doesn't not have colors nor the sweeping line has a length longer than one 
character.  For sake of simplicity, no random starting positions or direction, 
it always starts at upper-left corning and goes towards southeast.


				   ONE-LINER


The following 224 characters is a stripped version from the initial commit 
(e685f67) as a one-liner:

W=($(tput cols) $(tput lines));P=(1 1);D=(1 1);L=\\/;clear;while sleep .05;do((i=(D[0]*D[1]+1)/2));echo -ne "\e[${P[1]};${P[0]}H${L:i:1}";for i in 0 1;do((P[i]+=D[i]));((P[i]<1||P[i]>W[i]))&&((D[i]*=-1,P[i]+=D[i]));done;done


                                   COPYRIGHT


sweeplines.sh is licensed under the MIT License.