Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/amnweb/yasb
Browse files Browse the repository at this point in the history
  • Loading branch information
amnweb committed Jan 20, 2025
2 parents 05322e3 + 53b6f7c commit 06e108c
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions docs/widgets/(Widget)-Clock.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Clock Widget Configuration

| Option | Type | Default | Description |
|-----------------|---------|-------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| `label` | string | `'\uf017 {%H:%M:%S}'` | The format string for the clock. You can use placeholders like `{%H:%M:%S}` to dynamically insert time information. |
| `label_alt` | string | `'\uf017 {%d-%m-%y %H:%M:%S}'` | The alternative format string for the clock. Useful for displaying additional time details. |
| `tooltip` | boolean | `True` | Whether to show the tooltip on hover. |
| `locale` | string | `""` | The locale to use for the clock. If not specified, it defaults to an empty string. |
| `update_interval` | integer | `1000` | The interval in milliseconds to update the clock. Must be between 0 and 60000. |
| `timezones` | list | `[]` | A list of timezones to cycle through. Each timezone should be a valid timezone string. |
| `callbacks` | dict | `{'on_left': 'toggle_label', 'on_middle': 'do_nothing', 'on_right': 'next_timezone'}` | Callbacks for mouse events on the clock widget. |
| `animation` | dict | `{'enabled': True, 'type': 'fadeInOut', 'duration': 200}` | Animation settings for the widget. |
| `container_padding` | dict | `{'top': 0, 'left': 0, 'bottom': 0, 'right': 0}` | Explicitly set padding inside widget container. |
| Option | Type | Default | Description |
| ------------------- | ------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `label` | string | `'\uf017 {%H:%M:%S}'` | The format string for the clock. You can use placeholders like `{%H:%M:%S}` to dynamically insert time information. |
| `label_alt` | string | `'\uf017 {%d-%m-%y %H:%M:%S}'` | The alternative format string for the clock. Useful for displaying additional time details. |
| `tooltip` | boolean | `True` | Whether to show the tooltip on hover. |
| `locale` | string | `""` | The locale to use for the clock. If not specified, it defaults to an empty string. |
| `update_interval` | integer | `1000` | The interval in milliseconds to update the clock. Must be between 0 and 60000. |
| `timezones` | list | `[]` | A list of timezones to cycle through. Each timezone should be a valid timezone string. |
| `callbacks` | dict | `{'on_left': 'toggle_label', 'on_middle': 'do_nothing', 'on_right': 'next_timezone'}` | Callbacks for mouse events on the clock widget. |
| `animation` | dict | `{'enabled': True, 'type': 'fadeInOut', 'duration': 200}` | Animation settings for the widget. |
| `container_padding` | dict | `{'top': 0, 'left': 0, 'bottom': 0, 'right': 0}` | Explicitly set padding inside widget container. |

## Example Configuration

```yaml
clock:
type: "yasb.clock.ClockWidget"
options:
label: "uf017 {%H:%M:%S}"
label: "\uf017 {%H:%M:%S}"
label_alt: "\uf017 {%d-%m-%y %H:%M:%S}"
locale: ""
update_interval: 1000
Expand All @@ -30,6 +30,7 @@ clock:
```
## Description of Options
- **label:** The format string for the clock. You can use placeholders like `{%H:%M:%S}` to dynamically insert time information.
- **label_alt:** The alternative format string for the clock. Useful for displaying additional time details.
- **locale:** The locale to use for the clock. If not specified, it defaults to an empty string.
Expand All @@ -43,10 +44,17 @@ clock:
Clock format https://docs.python.org/3/library/time.html#time.strftime

## Example Style

```css
.clock-widget {}
.clock-widget .widget-container {}
.clock-widget .widget-container .label {}
.clock-widget .widget-container .label.alt {}
.clock-widget .widget-container .icon {}
```
.clock-widget {
}
.clock-widget .widget-container {
}
.clock-widget .widget-container .label {
}
.clock-widget .widget-container .label.alt {
}
.clock-widget .widget-container .icon {
}
```

0 comments on commit 06e108c

Please sign in to comment.