Guido van Rossum | 453bd40 | 1992-03-30 13:18:37 +0000 | [diff] [blame] | 1 | Newsgroups: cwi.sgi |
| 2 | Subject: Re: new clock |
| 3 | Distribution: cwi.sgi |
| 4 | References: <2246@charon.cwi.nl> |
| 5 | |
| 6 | Last week I wrote: |
| 7 | |
| 8 | >For your enjoyment I have implemented a colorful clock. |
| 9 | |
| 10 | The clock has now been extended with some new facilities: a menu, an |
| 11 | alarm and a gong. These may require some explanation beyond what's in |
| 12 | the usage message. |
| 13 | |
| 14 | Menu |
| 15 | ---- |
| 16 | The right mouse button now pops up a menu that allows you to turn the |
| 17 | seconds hand on or off and to switch the alarm off. |
| 18 | |
| 19 | Alarm |
| 20 | ----- |
| 21 | |
| 22 | The left and middle buttons set the alarm. When it is on, the alarm |
| 23 | time is displayed as a time on a 24 hour clock in the bottom left |
| 24 | corner. It is also indicated by two red triangles, corresponding to the |
| 25 | little (hours) and big (minutes) hand. These hands can be moved around: |
| 26 | the left mouse button moves the minutes hand, the middle button moves |
| 27 | the hourds hand. Watch out for differences of twelve hours (always |
| 28 | check the digital display); these can be corrected by dragging the hours |
| 29 | hand once around the dial. |
| 30 | |
| 31 | When the alarm goes off, two things happen: a shell command specified on |
| 32 | the command line with the -a option is executed (in the background), and |
| 33 | the clock's colors change every two seconds, for five minutes. You can |
| 34 | also turn the alarm off by using the menu accessible through the right |
| 35 | mouse button. |
| 36 | |
| 37 | There is no default command for the -a option; if it is not specified, |
| 38 | only the changing of the colors happens. If you have an 8 ohm speaker |
| 39 | connected to the audio output of your Personal Iris, a suitable command |
| 40 | would be: |
| 41 | |
| 42 | mclock -a '/ufs/guido/bin/sgi/play /ufs/guido/lib/sounds/alarm' |
| 43 | |
| 44 | Gong |
| 45 | ---- |
| 46 | |
| 47 | Some people like a clock that makes noises every hour, or even more |
| 48 | often. This is supported by the -g and -G options. With -g you specify |
| 49 | a shell command to be executed to sound the gong; with -G you can |
| 50 | specify the interval between gong calls, in seconds (default is one hour). |
| 51 | The shell command is executed in the background. It is given two |
| 52 | arguments: the hours (on a 24 hour clock!) and the minutes. The |
| 53 | executable Python script /ufs/guido/bin/sgi/chime is a suitable example. |
| 54 | Again, this only works if you have installed a speaker (I bet 8 ohm |
| 55 | speakers are going to be in demand!) |
| 56 | |
| 57 | -- |
| 58 | Guido van Rossum, Centre for Mathematics and Computer Science (CWI), Amsterdam |
| 59 | guido@cwi.nl or ..!hp4nl!cwi.nl!guido or guido%cwi.nl@uunet.uu.net |
| 60 | "A thing of beauty is a joy till sunrise" |