Skip to content
Andy Russell edited this page May 28, 2022 · 44 revisions

The clock module displays the current date and time.

Config

Addressed by clock

option typeof default description
interval integer 60 The interval in which the information gets polled.
format string {:%H:%M} The format, how the date and time should be displayed. See format options below.
today-format string <b><u>{}</u></b> The formatting of today's date in the {calendar}
format-calendar string The format, how the {calendar} should be displayed
format-calendar-weekdays string The format, how the weekdays(SU-SA) in {calendar} should be displayed
format-calendar-weeks string The format, how the week numbers in {calendar} should be displayed
calendar-weeks-pos string left,right The position where week numbers should be displayed. Disabled when is empty
timezone string The timezone to display the time in, e.g. America/New_York. See Wikipedia's unofficial list of timezones.
timezones list of strings A list of timezones (as in timezone) to use for time display, changed using the scroll wheel. Do not specify timezone option when timezones is specified.
locale string A locale to be used to display the time. Intended to render times in custom timezones with the proper language and format.
max-length integer The maximum length in character the module should display.
rotate integer Positive value to rotate the text label.
on-click string Command to execute when clicked on the module.
on-click-middle string Command to execute when you middle clicked on the module using mousewheel.
on-click-right string Command to execute when you right clicked on the module.
on-scroll-up string Command to execute when scrolling up on the module.
on-scroll-down string Command to execute when scrolling down on the module.
smooth-scrolling-threshold double Threshold to be used when scrolling.
tooltip bool true Option to enable tooltip on hover
tooltip-format string same as format Tooltip on hover

For valid format options have a look here.

Example:

  1. General
"clock": {
    "interval": 60,
    "format": "{:%H:%M}",
    "max-length": 25
}
  1. Calendar
"clock": {
    "today-format": "<span color='#ff6699'><b><u>{}</u></b></span>",
    "calendar-weeks-pos": "right",
    "format-calendar": "<span color='#ecc6d9'><b>{}</b></span>",
    "format-calendar-weeks": "<span color='#99ffdd'><b>W{}</b></span>",
    "format-calendar-weekdays": "<span color='#ffcc66'><b>{}</b></span>",
}

Style

  • #clock

Troubleshooting

If clock module is disabled at startup with locale::facet::_S_create_c_locale name not valid error message try one of the followings:

  • check if LC_TIME is set properly (glibc)
  • set locale to C in the config file (musl)

The locale option must be set for {calendar} to use the correct start-of-week, regardless of system locale.

Clone this wiki locally