-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
27 lines (13 loc) · 902 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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.