waybar - clock module
clock module displays current date and time
$XDG_CONFIG_HOME/waybar/config
Per user configuration file |
1. Addressed by clock |
View all valid format options in strftime(3) or have a look <https://fmt.dev/latest/syntax.html#chrono-specs>
2. Addressed by clock: calendar |
3. Addressed by clock: calendar: format |
•
{calendar}: Current month calendar
• {timezoned_time_list}: List of time in the
rest timezones, if more than one timezone is set in the
config
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}", |
}
• #clock
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.
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" |
||||
} |
},
Alexis Rouillard <[email protected]>