LinuxCommandLibrary

xclock

Display a graphical clock

TLDR

Display an analog clock

$ xclock
copy

Display a 24-hour digital clock with the hour and minute fields only
$ xclock -digital -brief
copy

Display a digital clock using an strftime format string (see strftime(3))
$ xclock -digital -strftime [format]
copy

Display a 24-hour digital clock with the hour, minute and second fields that updates every second
$ xclock -digital -strftime '%H:%M:%S' -update 1
copy

Display a 12-hour digital clock with the hour and minute fields only
$ xclock -digital -twelve -brief
copy

SYNOPSIS

xclock [-analog] [-digital] [-chime] [-hd ] [-hl ] [-fg ] [-bg ] [-bw ] [-geometry ] [-update ] [-strftime ] [-twelve] [-twentyfour] [-help] [-name ] [-xrm ]

PARAMETERS

-analog
    Display an analog clock.

-digital
    Display a digital clock.

-chime
    Enable a chime sound on the half hour and hour.

-hd
    Set the color of the clock hands.

-hl
    Set the highlight color.

-fg
    Set the foreground color.

-bg
    Set the background color.

-bw
    Set the border width.

-geometry
    Specify the size and position of the clock window.

-update
    Set the update interval in seconds. Default is 60 seconds for analog, 1 second for digital.

-strftime
    Specify the format string for the digital clock display using strftime(3) syntax.

-twelve
    Force 12-hour time display.

-twentyfour
    Force 24-hour time display.

-help
    Display help message.

-name
    Set the application name.

-xrm
    Set X resource values.

DESCRIPTION

The xclock program is a simple graphical clock for the X Window System. It displays the current time in either analog or digital format. It is a standard part of most X distributions and provides a basic timekeeping utility. xclock is highly configurable through command-line options, allowing users to customize its appearance, size, color, and display format. It is lightweight and consumes minimal system resources, making it suitable for environments where performance is critical. While xclock is primarily used for displaying the time, its customizable nature allows it to be used as a simple desktop ornament or a visual indicator of system activity. Different parameters may determine whether the clock appears on top of other windows, which may affect the desktop performance.

CAVEATS

The appearance of xclock can vary significantly depending on the X server and window manager in use. The '-strftime' option's behavior depends on the system's locale.

RESOURCES

xclock supports standard X resources for customizing its appearance. Some commonly used resources include 'background', 'foreground', 'borderColor', 'borderWidth', 'handColor', 'highlightColor', 'update', and 'strftime'. These resources can be set in the .Xdefaults file or through the xrdb command.

For example:

XClock*background: black
XClock*foreground: white

HISTORY

xclock has been a standard utility in the X Window System since its early days. It was designed as a simple and straightforward way to display the current time graphically. Over time, its functionality has remained relatively unchanged, focusing on providing a basic clock display with some customization options. Its longevity speaks to its utility and simplicity within the X environment.

SEE ALSO

date(1)

Copied to clipboard