123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #!/bin/bash
- AS=🌏
- EU=🌍
- AM=🌎
- NIGHT="🌙"
- DAY="☀️ "
- TZONES="America/Los_Angeles America/Denver America/New_York Europe/Amsterdam Asia/Tokyo Australia/Brisbane"
- H=`date +%H`
- if (test $H -gt 2 -a $H -lt 9); then
- WORLD=$AS
- elif (test $H -gt 9 -a $H -lt 18); then
- WORLD=$EU
- else
- WORLD=$AM
- fi
- function print_clock() {
- TZ=$1
- H=$(TZ=$1 date +%H)
- COLOR=""
- if (test $H -gt 8 -a $H -lt 19); then
- echo -n $WORLD
- COLOR="\033[1;33m"
- else
- echo -n $NIGHT
- COLOR="\033[1;34m"
- fi
- if (test $H -gt 5 -a $H -lt 9); then
- COLOR="\033[0;33m"
- fi
- if (test $H -gt 19 -a $H -lt 23); then
- COLOR="\033[0;36m"
- fi
- echo -ne "${COLOR} $1\r\t\t\t\t: "
- TZ=$1 date -R
- }
- while (true); do
- clear
- for t in $TZONES; do
- print_clock $t
- done
- sleep 61
- done
|