[linux-l] Weltzeituhr

Frank Reker frank at reker.net
Do Nov 2 18:56:37 CET 2006


Am Thu 02. Nov 2006 15:53 +0000 schrieb Peter Ross:

>Hier mein Opensource-Beitrag;-)
>clocks.sh:

also wenn dann schon richtig ;-)

----snip----
#!/bin/bash

sizex=164
sizey=164
framex=6
framey=31

posx=0
posy=24
maxx=1024
maxy=768

zones="Australia/Melbourne:Blue Europe/London:NavyBlue Asia/Dubai:Brown "
zones="$zones Asia/Shanghai:Red Asia/Tokyo:Yellow Europe/Berlin:Green "
zones="$zones America/Lima:Grey "

case "$1" in
start)
    for n in $zones; do
      l=`echo $n | awk -F: '{print $1}'`
      t=`echo $l | awk -F/ '{print $2}'`
      c=`echo $n | awk -F: '{print $2}'`
      TZ="$l" xclock -name "$t" -bg $c -geometry ${sizex}x${sizey}+${posx}+${posy} &
      j="$!"
      echo $j >> ~/.clock.sh.pids
      posx=$((posx+sizex+framex))
      if test "$posx" -gt $((maxx-sizex-framex)); then
        posx=0
        posy=$((posy+sizey+framey))
      fi
    done
    ;;
stop)
    for i in $(cat ~/.clock.sh.pids | sort | uniq); do
       kill -9 "$i"
    done
    rm -f ~/.clock.sh.pids
    ;;
restart)
    $0 stop
    $0 start
    ;;
*)
    echo "$(basename $0): usage $(basename $0) start|stop|restart" >&2
    exit 1
    ;;
esac

----snap----


-- 
Don't worry be happy ...
Ciao Frank
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : nicht verfügbar
Dateityp    : application/pgp-signature
Dateigröße  : 189 bytes
Beschreibung: nicht verfügbar
URL         : <https://mlists.in-berlin.de/pipermail/linux-l-mlists.in-berlin.de/attachments/20061102/297858b4/attachment.sig>


Mehr Informationen über die Mailingliste linux-l