Customizable wall clock for several time zones

C. P. Ghost cpghost at cordula.ws
Sun Aug 22 00:51:54 UTC 2010


On Sun, Aug 22, 2010 at 1:19 AM, Gary Kline <kline at thought.org> wrote:
> On Sat, Aug 21, 2010 at 05:52:24AM +0200, Polytropon wrote:
>> I'm searching for a round-clock style clock application for X,
>> and I would prefer a standalone program (not integrated with
>> KDE, Gnome, or else). It should be possible to define several
>> timezones and attach a label to each clock (which doesn't have
>> to contain the name of the time zone, but an arbitrary string).
>>
>> It should look something like this:
>>
>>       []========= The clock =========X
>>       |   ____      ____      ____   |
>>       |  /  | \    / \  \    /   /\  |
>>       | |   +- |  |  -+  |  |   +  | |
>>       |  \____/    \____/    \__|_/  |
>>       |   BLAH      MEOW    DOGFOOD! |
>>       +------------------------------+
>>
>> Just as bankers and dynamical long-legged success-oriented
>> group-dependent program managers use them. :-)
>>
>> In the ports, I found intclock, but it doesn't have round clocks,
>> and additionally, it allows to add UTC, and it is shown, but upon
>> program restart, it complains that "Timezone UTC not defined.".
>>
>> There is no need for a GUI configuration tool if the use of a
>> configuration file is documented, and then just contains the
>> TZ name and the label per clock, as simple as possible.
>>
>> Does such a program already exist?
>
>
>        how about using multiple instantiations of xclock?    i used to have a
>        script with TZ= zulu, TZ=moscow, TZ=tokyo.

Yes, you can do that and it works like a charm:

  #!/bin/sh
  # display multiple xclock(1)s side by side
  for TIMEZONE in ZONE1 ZONE2 ZONE3 ...
  do
      env TZ=$TIMEZONE xclock
  done

(replace ZONE1, ZONE2, ZONE3 with real time zones
from /usr/share/zoneinfo)

You could even set the xclock(s) nicely side by side by using
the -geometry flag as in:

  env TZ=$TIMEZONE xclock -geometry "${WIDTH}x${HEIGHT}+${XOFF}+${YOFF}"

I suggest to keep WIDTH, HEIGHT and YOFF constant, and
to increment XOFF by $WIDTH plus some small constant for
every new timezone (use 'expr' to do arithmetic). This way,
you get them all arrayed side by side.

-cpghost.

-- 
Cordula's Web. http://www.cordula.ws/


More information about the freebsd-questions mailing list