~scripts
40 itemsDownload ./*


..
dzen2
tiling
vosh
4cdl
4trips
alarm
ambient
battery-monitor
checkit
cleverbot.py
clock
color-gen
colors-hex
compton
dailywall
dmenu
importw
indexer
keep-on
mp3ogg
orage
pipes
pipes.x
rain
randwall
screen-dim
screencast
screencast2
scrot
scrotw
search
skull
slocker
starwars
streamit
sumnum
tty-colorize
usrmount
ytp
ytplay


scriptsclock
2 years agoDownloadRawClose


#!/bin/bash
#
# Author: Twily     2014
#

unhide_cursor() { printf "\e[?25h"; }
trap unhide_cursor EXIT

STRW=`expr 6 \* 3 + 2`  # String length "00:00:00" in character blocks produced by toilet font
STRH=3                  # String height "00:00:00" in character blocks produced by toilet font
SPACEW=3                # "Space" length in character block produced by toilet font

# This will center the clock, but resizing will leave artifacts
function center {
    TW=`tput -S <<< cols`
    TH=`tput -S <<< lines`

    A1=`expr $TH - $STRH`
    A1=`expr $A1 / 2`
    A2=`expr $TW - $STRW`
    A2=`expr $A2 / 2`
    A2=`expr $A2 / $SPACEW`
}

clear
center
printf "\e[?25l"
while true; do
    printf "\033[;H"

    B2=""
    for i in `seq 1 $A1`; do echo ""; done
    for i in `seq 1 $A2`; do B2="$B2 "; done

    toilet -f future -t --g <<< "$B2`date +'%H:%M:%S'`"
    sleep .1
done

Top
twily at openmailbox dot org
©twily.info 2013 - 2017



744 049 visits
... ^ v