Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

time(3C)

NAME

xclock − continuously display the time in either analog or digital form. 

SYNTAX

xclock [options]

DESCRIPTION

xclock continuously displays the time of day, either in digital or analog form.  In digital form, xclock displays the time using a 24-hour clock.  It also displays the day, month, and year.  In analog form, xclock displays a standard 12-hour clock face.  You can set up more than one clock simultaneously. 

The default clock is an analog clock with a black foreground on a white background.  If you want to change the clock’s appearance, type in the appropriate options.  For example, % xclock -bd slateblue -fg navyblue -hl darkslategray & sets up a conventional 12-hour clock with a slate blue window border, navy blue tick marks, and dark slate gray hands. 

By default, the clock is positioned in the upper-left corner of your background window.  If you are running the default version of mwm, the window manager will place the clock in the upper-left quadrant of the screen, offset from the corner. 

OPTIONS

xclock accepts all of the standard X Toolkit command-line options, which are listed on the X reference page.  (We’ve included some of the more commonly used Toolkit options later in this section.)  In addition, xclock accepts the following application-specific options:

-helpDisplays a brief summary of xclock’s calling syntax and options. 

-analog
Draws a conventional 12-hour clock face with tick marks for each minute and stroke marks for each hour.  This is the default.

-digital or -d
Displays the date and time in digital format. Note that -display must be used to specify a display. 

-chime
Indicates that the clock should chime once on the half hour and twice on the hour.

-hd color
Specifies the color of the hands on an analog clock.  The default is black.

-hl color
Specifies the color of the edges of the hands on an analog clock. Only useful on color displays.  The default is black.

-padding pixels
Specifies the width in pixels of the space between the window border and any portion of the xclock display.  The default is 10 pixels in digital mode and 8 pixels in analog mode. 

-update seconds
Specifies the frequency in seconds with which xclock updates its display. If the xclock window is obscured and then exposed, xclock overrides this setting and redisplays immediately.  A value of less than 30 seconds will enable a second hand on an analog clock.  The default is 60 seconds. 

The following standard X Toolkit options are commonly used with xclock:

-bw pixels
Specifies the width in pixels of the border around the xclock window.  The default is 2 pixels. 

-fg color
Determines the color of the text in digital mode, and the color of the tick and stroke marks in analog mode.  The default is black.

-fn font
Specifies the font to be used in digital mode. Any fixed-width font may be used. The default is 6x10. 

-geometry  geometry
Sets xclock window size and location according to the geometry specification.  The -geometry option can be (and often is) abbreviated to -g, unless there is a conflicting option that begins with "g".  The argument to the geometry option (geometry) is referred to as a "standard geometry string," and has the form widthxheight±xoff±yoff.  In digital mode, height and width are determined by the font in use, unless otherwise specified. In analog mode, width and height defaults are 164 pixels, unless otherwise specified.  The default value for any unspecified x or y offset is -0.  All values are in pixels.  If you do not specify the geometry, the window manager may place the window; if not, xclock will ask you for placement when it starts up. 

-display [host]:server[.screen]
Allows you to specify the physical display, server, and screen on which to create the xclock window.  See "Options" on the X reference page for an example of usage.  Note that -display cannot be abbreviated to -d, which is shorthand for xclock’s -digital option. 

-xrm resourcestring
Specifies a resource string to be used.  This is especially useful for setting resources that do not have separate command-line options.

RESOURCES

xclock uses the Athena Clock widget.  It understands all of the Core resource names and classes as well as the new resources defined by the Clock widget.  Resources you may want to set in user resource files include:

analog (class Boolean)
Specifies whether or not an analog clock should be used instead of a digital one.  The default is true. 

chime (class Boolean)
Specifies whether or not a bell should be rung on the half hour and on the hour.  The default is false. 

hands (class Foreground)
Specifies the color of the insides of the clock’s hands. The default is the foreground color. 

highlight (class Foreground)
Specifies the color used to highlight the clock’s hands. The default is the foreground color. 

padding (class Margin)
Specifies the amount of internal padding in pixels to be used.  The default is 8.

update (class Interval)
Specifies the frequency in seconds at which the time should be redisplayed.

You may also want to set the following X Toolkit resources:

background (class Background)
Determines the background color.  The default is white.

font (class Font)
Specifies the font to be used for the digital clock.  Note that variable-width fonts currently will not always display correctly.

foreground (class Foreground)
Specifies the color for the tick marks and stroke marks.  Using the class specifies the color for all things that normally would appear in the foreground color. The default is black since the core default for background is white.

height (class Height)
Specifies the height of the clock.

reverseVideo (class ReverseVideo)
Specifies that the foreground and background colors should be reversed.

width (class Width)
Specifies the width of the clock.

WIDGET HIERARCHY

In order to specify resources, it is useful to know the hierarchy of the widgets which compose xclock.  In the notation below, indentation indicates hierarchical structure.  The widget class name is given first, followed by the widget instance name.  XClock  xclock  Clock  clock

FILES

/usr/lib/X11/app-defaults/XClock
Specifies default resources.

BUGS

xclock believes the system clock. 

When in digital mode, the string should be centered automatically. 

There should be a way to exit the program. 

SEE ALSO

X, oclock, xrdb, time(3C); Chapter 8, Other Clients; Appendix G, Athena Widget Resources. 

AUTHORS

Tony Della Fera (MIT-Athena, DEC);
Dave Mankins (MIT-Athena, BBN);
Ed Moy (UC Berkeley).

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026