-
Notifications
You must be signed in to change notification settings - Fork 80
Clock Widget
Dan edited this page Feb 13, 2022
·
2 revisions
The widget yasb.clock.ClockWidget displays the current date and time, allows for cycling between different time-zones, and alternating between datetime formats.
type: "yasb.clock.ClockWidget"
option | type | default | description |
---|---|---|---|
label |
str | {%H:%M:%S} |
The label format of the widget. Accepts a string with valid python datetime format enclosed between curly brackets. |
label_alt |
str | {%d-%m-%y %H:%M:%S} |
The alternate label format of the widget. See above for datetime format options. |
update_interval |
int | 1000 |
The interval at which the widget will update itself. Accepts a positive integer representing the timeout period between clock update cycles (milliseconds). |
timezones |
list[str] | [] |
A list of cycle-able time-zones. Accepts a list of time-zone strings e.g. ["Europe/London", "America/New_York"]
|
callbacks |
dict[str] | see callbacks | Left, middle and right-click widget behaviour. |
callback | type | default | description |
---|---|---|---|
on_left |
str | "toggle_label" |
Action triggered when the widget is left-clicked. |
on_middle |
str | "do_nothing" |
Action triggered when the widget is middle-clicked. |
on_right |
str | "next_timezone" |
Action triggered when the widget is right-clicked. |
-
"toggle_label"
- toggles betweenlabel
andlabel_alt
formats -
"next_timezone"
- cycles the next time-zone specified intimezones
list -
"do_nothing"
- does nothing
example-clock-widget:
type: "yasb.clock.ClockWidget"
options:
label: "{%H:%M:%S}"
label_alt: "{%d-%m-%y %H:%M:%S}"
update_interval: 1000
timezones: []
callbacks:
on_left: "toggle_label"
on_middle: "do_nothing"
on_right: "next_timezone"
-
.clock-widget
.label
.label-alt
Something not quite right? Please consider submitting an issue if you think this Wiki needs to be updated.
- Home
- Installation
- Configuration
- Styling
- Widgets:
- FAQ