tCan now render monochrome pipes - scripts - various script and utils
 (HTM) git clone git://z3bra.org/scripts
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
 (DIR) commit db5a243a3233cb0a78cf0db0bfedd64d7c103772
 (DIR) parent 979f9e6250043e51a90cd52c1a83477dcdbc51c3
 (HTM) Author: z3bra <willy@mailoo.org>
       Date:   Fri, 28 Mar 2014 09:53:31 +0100
       
       Can now render monochrome pipes
       
       Diffstat:
         M pipes                               |       7 +++++--
       
       1 file changed, 5 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/pipes b/pipes
       t@@ -9,13 +9,15 @@ declare -ar v=( [00]="\x83" [01]="\x8f" [03]="\x93"
                [30]="\x97" [32]="\x8f" [33]="\x81" )
        
        OPTIND=1
       -while getopts "f:s:r:h" arg; do
       +while getopts "cf:s:r:h" arg; do
        case $arg in
       +    c) COLOR=true;;
            f) ((f=($OPTARG>19 && $OPTARG<101)?$OPTARG:$f));;
            s) ((s=($OPTARG>4 && $OPTARG<16 )?$OPTARG:$s));;
            r) ((r=($OPTARG>0)?$OPTARG:$r));;
            h) echo -e "Usage: pipes [OPTION]..."
                echo -e "Animated pipes terminal screensaver.\n"
       +        echo -e " -c\t\tUse random colors for pipes"
                echo -e " -f [20-100]\tframerate (D=75)."
                echo -e " -s [5-15]\tprobability of a straight fitting (D=13)."
                echo -e " -r LIMIT\treset after x characters (D=2000)."
       t@@ -44,7 +46,8 @@ while ! read -t0.0$((1000/$f)) -n1; do
        
            # Print:
            tput cup $y $x
       -    echo -ne "\033[1;3${c}m\xe2\x94${v[$l$n]}"
       +    test "$COLOR" = "true" && echo -ne "\033[1;3${c}m"
       +    echo -ne "\xe2\x94${v[$l$n]}"
            (($t>$r)) && tput reset && tput civis && t=0 || ((t++))
            l=$n
        done