XDaliClock(1) USER COMMANDS XDaliClock(1) NAME xdaliclock - melting digital clock SYNOPSIS xdaliclock [-_t_o_o_l_k_i_t_o_p_t_i_o_n ...] [-_o_p_t_i_o_n ...] DESCRIPTION The _x_d_a_l_i_c_l_o_c_k program displays a digital clock; when a digit changes, it ``melts'' into its new shape. This program was inspired by the Alto and Macintosh programs of the same name, written by Steve Capps in 1983 or 1984. OPTIONS _x_d_a_l_i_c_l_o_c_k accepts all of the standard toolkit options, and also accepts the following options: -help Print a brief summary of the allowed options on the standard error output. -12 Use a twelve hour clock. -24 Use a twenty-four hour clock. -seconds Update every second. -noseconds Update once per minute; don't display seconds at all. -cycle Do color-cycling. -nocycle Don't do color-cycling. -shape Use the Shape Extension, if it's available, to make the window background be transparent. This doesn't interact terribly well with the _t_w_m or _t_v_t_w_m window managers, unless they have been config- ured to not put a titlebar on the _x_d_a_l_i_c_l_o_c_k window. If this isn't specified in your ._t_w_m_r_c or ._t_v_t_w_m_r_c file, then the window will flicker constantly, as the window manager tries to add and remove the titlebar ten times each second. Also, this turns most X servers into huge cycle hogs. This is probably because of inefficient implementations of the Shape extension. -noshape X Version 11 Last change: 18-sep-91 1 XDaliClock(1) USER COMMANDS XDaliClock(1) Don't use the Shape Extension. -memory low Use high-bandwidth, low-memory mode. If you have a very fast connection between the machine this pro- gram is running on and the X server it is displaying on, then _x_d_a_l_i_c_l_o_c_k can work correctly by simply making the drawing requests it needs when it needs them. This is _t_h_e _e_l_e_g_a_n_t _m_e_t_h_o_d. However, the amount of data necessary to animate the display ends up being a bit over 10 kilobytes worth of X Protocol per second. On a fast machine with a local display, or over a fast network, that's almost negligible, but (for example) an NCD X Terminal at 38.4 kilobaud can't keep up. That is the reason for: -memory medium Use high-memory, low-bandwidth mode. In this mode, _x_d_a_l_i_c_l_o_c_k precomputes most of the frames that it will ever need. This is _t_h_e _s_l_e_a_z_y _c_o_p_o_u_t _m_e_t_h_o_d. The bandwidth requirements are drastically reduced, because instead of telling the server what bits to draw where, it merely tells it what pixmaps to copy into the window. Aside from the fact that I con- sider this to be _c_h_e_a_t_i_n_g, the only downside of this method is that those pixmaps (about 170 of them, each the size of one character) are consuming server-memory. This probably isn't a very big deal, unless you're using an exceptionally large font. -memory high With _m_e_m_o_r_y set to _h_i_g_h, the cache is twice as large (the _n -> _n+_2 transitions are cached as well as the _n -> _n+_1 ones). Even with memory set to _m_e_d_i_u_m, this program can seem sluggish when using the buil- tin font over a very slow connection to the display server. -font _f_o_n_t_n_a_m_e Specifies the X font to use; _x_d_a_l_i_c_l_o_c_k can correctly animate any font that contains all the digits plus colon and slash, and in which the letters aren't excessively curly. The _x_d_a_l_i_c_l_o_c_k program contains a builtin bitmapped font, which is larger and more attractive than the standard X fonts. This font will be used if the -_f_o_n_t option is given the fontname BUILTIN. -builtin This is the same as specifying -_f_o_n_t _B_U_I_L_T_I_N. X Version 11 Last change: 18-sep-91 2 XDaliClock(1) USER COMMANDS XDaliClock(1) monly The following standard X Toolkit command line arguments are com- used with _x_d_a_l_i_c_l_o_c_k: -display _h_o_s_t:_d_p_y This option specifies the X server to contact. -geometry _g_e_o_m_e_t_r_y This option specifies the prefered size and position of the clock window. -bg _c_o_l_o_r This option specifies the color to use for the back- ground of the window. The default is ``white.'' -fg _c_o_l_o_r This option specifies the color to use for the fore- ground of the window. The default is ``black.'' -rv This option indicates that reverse video should be simulated by swapping the foreground and background colors. -bw _n_u_m_b_e_r This option specifies the width in pixels of the border surrounding the window. -xrm _r_e_s_o_u_r_c_e_s_t_r_i_n_g This option specifies a resource string to be used. COMMANDS Clicking and holding any mouse button in the _x_d_a_l_i_c_l_o_c_k win- dow will cause it to display the date (in _m_m/_d_d/_y_y format) while the button is held. Typing ``space'' at the _x_d_a_l_i_c_l_o_c_k window will toggle between a twelve hour and twenty-four hour display. Typing ``q'' or ``C-c'' at the window quits. If the _x_d_a_l_i_c_l_o_c_k window is iconified or otherwise unmapped, it will go to sleep until it is mapped again. X DEFAULTS _x_d_a_l_i_c_l_o_c_k understands all of the core resource names and classes as well as: seconds (class Seconds) Whether to display seconds. If true, this is the same as the -_s_e_c_o_n_d_s command line argument; if false, this is the same as -_n_o_s_e_c_o_n_d_s. X Version 11 Last change: 18-sep-91 3 XDaliClock(1) USER COMMANDS XDaliClock(1) cycle (class Cycle) Whether to do color cycling. If true, this is the same as the -_c_y_c_l_e command line argument; if false, this is the same as -_n_o_c_y_c_l_e. shape (class Shape) Whether to use the Shape Extension, if available. If true, this is the same as the -_s_h_a_p_e command line argument; if false, this is the same as -_n_o_s_h_a_p_e. memory (class Memory) This must be _h_i_g_h, _m_e_d_i_u_m, or _l_o_w, the same as the -_m_e_m_o_r_y command-line option. mode (class Mode) Whether to display 12-hour or 24-hour time. If 12, this is the same as the -_1_2 command line argument; if 24, this is the same as -_2_4. font (class Font) The same as the -_f_o_n_t command line option: the font to melt. If this is the string BUILTIN, then the large builtin font is used; otherwise, it must be the name of a valid X font. ENVIRONMENT DISPLAY to get the default host and display number. XENVIRONMENT to get the name of a resource file that overrides the global resources stored in the RESOURCE_MANAGER property. SEE ALSO X(1), xrdb(1), xlsfonts(1), xclock(1), dclock(1), oclock(1), tclock(1) BUGS Other system load will sometimes cause the second-display to increment by more than one second at a time, in order to remain synchronized to the current time. The -_m_e_m_o_r_y option is disgusting and shouldn't be necessary, but I'm not clever enough to eliminate it. It has been said that hacking graphics in X is like finding _s_q_r_t(_p_i) with roman numerals. When using a small font (less than 48x56 or so) it's possi- ble that shipping a bitmap to the server would be more effi- cient than sending a DrawSegments request (since the end- points are specified using 16 bits each, when all that we really need is 6 or 7 bits.) X Version 11 Last change: 18-sep-91 4 XDaliClock(1) USER COMMANDS XDaliClock(1) Support for the Shared Memory Extension would be a good thing. There should be a switch to do the date in _d_d/_m_m/_y_y or _y_y/_m_m/_d_d format. I want the day of the week in there some- where, too. This should be hooked up to _x_l_o_c_k(_1) or something like it. Should double the size of the builtin font, for full-screen mode. The color cycling should be less predictable; it should vary saturation and intensity as well, and should be more careful that foreground and background contrast well. COPYRIGHT Copyright 1991, Jamie Zawinski. Permission to use, copy, modify, distribute, and sell this software and its documen- tation for any purpose is hereby granted without fee, pro- vided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. No representa- tions are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. AUTHOR Jamie Zawinski , 18-sep-91. Please let me know if you find any bugs or make any improve- ments. Thanks to Ephraim Vishniac for explain- ing the format of the bitmap resources in the Macintosh ver- sion of this, so that I could snarf them for the -_b_u_i_l_t_i_n option. And thanks to Steve Capps for the really great idea. X Version 11 Last change: 18-sep-91 5