Man page - waybar-clock(5)

Packages contains this manual

Manual

waybar-clock

NAME
DESCRIPTION
FILES
CONFIGURATION
Actions
FORMAT REPLACEMENTS
EXAMPLES
STYLE
Troubleshooting
Calendar in Chinese. Alignment
AUTHOR

NAME

waybar - clock module

DESCRIPTION

clock module displays current date and time

FILES

$XDG_CONFIG_HOME/waybar/config

Per user configuration file

CONFIGURATION

1. Addressed by clock

Image grohtml-4157571-1.png

View all valid format options in strftime(3) or have a look https://en.cppreference.com/w/cpp/chrono/duration/formatter

2. Addressed by clock: calendar

Image grohtml-4157571-2.png

3. Addressed by clock: calendar: format

Image grohtml-4157571-3.png

Actions

Image grohtml-4157571-4.png

FORMAT REPLACEMENTS

β€’

{calendar} : Current month calendar

β€’

{tz_list} : List of time in the rest timezones, if more than one timezone is set in the config

β€’

{ordinal_date} : The current day in (English) ordinal form, e.g. 21st

EXAMPLES

1. General

"clock": {

"interval": 60,

"format": "{:%H:%M}",

"max-length": 25

}

2. Calendar

"clock": {

"format": "{:%H:%M} ο€— ",

"format-alt": "{:%A, %B %d, %Y (%R)} ο—― ",

"tooltip-format": "<tt><small>{calendar}</small></tt>",

"calendar": {

"mode" : "year",

"mode-mon-col" : 3,

"weeks-pos" : "right",

"on-scroll" : 1,

"on-click-right": "mode",

"format": {

"months": "<span color=’#ffead3’><b>{}</b></span>",

"days": "<span color=’#ecc6d9’><b>{}</b></span>",

"weeks": "<span color=’#99ffdd’><b>W{}</b></span>",

"weekdays": "<span color=’#ffcc66’><b>{}</b></span>",

"today": "<span color=’#ff6699’><b><u>{}</u></b></span>"

}

},

"actions": {

"on-click-right": "mode",

"on-click-forward": "tz_up",

"on-click-backward": "tz_down",

"on-scroll-up": "shift_up",

"on-scroll-down": "shift_down"

}

},

3. Full date on hover

"clock": {

"interval": 60,

"tooltip": true,

"format": "{:%H.%M}",

"tooltip-format": "{:%Y-%m-%d}",

}

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 following:

β€’

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.

Calendar in Chinese. Alignment

In order to have aligned Chinese calendar there are some useful recommendations:

1.

Use "WenQuanYi Zen Hei Mono" which is provided in most Linux distributions

2.

Try different font sizes and find best for you. size = 9pt should be fine

3.

In case when "WenQuanYi Zen Hei Mono" font is used disable monospace font pango tag

Example of working config

"clock": {

"format": "{:%H:%M} ο€— ",

"format-alt": "{:%A, %B %d, %Y (%R)} ο—― ",

"tooltip-format": "n<span size=’9pt’ font=’WenQuanYi Zen Hei Mono’>{calendar}</span>",

"calendar": {

"mode" : "year",

"mode-mon-col" : 3,

"weeks-pos" : "right",

"on-scroll" : 1,

"on-click-right": "mode",

"format": {

"months": "<span color=’#ffead3’><b>{}</b></span>",

"days": "<span color=’#ecc6d9’><b>{}</b></span>",

"weeks": "<span color=’#99ffdd’><b>W{}</b></span>",

"weekdays": "<span color=’#ffcc66’><b>{}</b></span>",

"today": "<span color=’#ff6699’><b><u>{}</u></b></span>"

}

},

"actions": {

"on-click-right": "mode",

"on-click-forward": "tz_up",

"on-click-backward": "tz_down",

"on-scroll-up": "shift_up",

"on-scroll-down": "shift_down"

}

},

AUTHOR

Alexis Rouillard <contact@arouillard.fr>