-
Notifications
You must be signed in to change notification settings - Fork 0
(Widget) Custom
github-actions edited this page Apr 21, 2025
·
11 revisions
| Option | Type | Default | Description |
|---|---|---|---|
label |
string | "{data}" |
The format string for data |
label_alt |
string | "{data}" |
Example of label alt. |
label_max_length |
int | None |
The maximum length of the label. |
class_name |
string | "custom-widget" |
The CSS class name for the widget. |
exec_options |
dict | {'run_cmd': None, 'run_interval': 120000, 'return_format': 'json', 'hide_empty: False', use_shell: True, encoding: None} |
Execution options for custom widget. |
callbacks |
dict | {'on_left': 'toggle_label', 'on_middle': 'do_nothing', 'on_right': 'do_nothing'} |
Callbacks for mouse events. |
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. |
container_shadow |
dict | None |
Container shadow options. |
label_shadow |
dict | None |
Label shadow options. |
ip_info:
type: "yasb.custom.CustomWidget"
options:
label: "<span>\udb81\udd9f</span> {data[ip]}"
label_alt: "<span>\uf450</span> {data[city]} {data[region]}, {data[country]}"
class_name: "ip-info-widget"
exec_options:
run_cmd: "curl.exe https://ipinfo.io"
run_interval: 120000 # every 5 minutes
return_format: "json"
hide_empty: false
callbacks:
on_left: "toggle_label"
on_middle: "exec cmd /c ncpa.cpl" # open network settings
on_right: "exec cmd /c start https://ipinfo.io/{data[ip]} " # open ipinfo in browser
label_shadow:
enabled: true
color: "black"
radius: 3
offset: [ 1, 1 ]nvidia_temp:
type: "yasb.custom.CustomWidget"
options:
label: "{data}<span>\udb81\udd04</span>"
label_alt: "{data}"
class_name: "system-widget"
exec_options:
run_cmd: "powershell nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader"
run_interval: 10000 # run every 10 sec
return_format: "string"
hide_empty: falsenvidia_temp:
type: "yasb.custom.CustomWidget"
options:
label: "London {data[current][temperature_2m]}{data[current_units][temperature_2m]}"
label: "London {data[current][temperature_2m]}{data[current_units][temperature_2m]}"
class_name: "custom-widget"
exec_options:
run_cmd: "curl.exe http://api.open-meteo.com/v1/forecast?latitude=51.5074&longitude=-0.1278¤t=temperature_2m&timezone=auto"
run_interval: 1800000 # run every 30 min
return_format: "json"
hide_empty: false
use_shell: false- label: The format string.
- label_alt: The alternative format string.
-
label_max_length: The maximum length of the label. Minimum value is 1. Default is
None. - class_name: The CSS class name for the widget.
-
exec_options: A dictionary specifying the execution options. The keys are
run_cmdcommand to run,run_interval(in milliseconds),return_formatcan bejsonorstring,hide_empty(boolean) hide widget if output is empty,use_shelluse shell to run command,encodingencoding for the command output, can be utf-8, cp1252, etc. -
callbacks: A dictionary specifying the callbacks for mouse events. The keys are
on_left,on_middle, andon_right, and the values are the names of the callback functions. -
animation: A dictionary specifying the animation settings for the widget. It contains three keys:
enabled,type, andduration. Thetypecan befadeInOutand thedurationis the animation duration in milliseconds. - container_padding: Explicitly set padding inside widget container. Use this option to set padding inside the widget container. You can set padding for top, left, bottom and right sides of the widget container.
- container_shadow: Container shadow options.
- label_shadow: Label shadow options.
.custom-widget {}
.custom-widget .widget-container {}
.custom-widget .widget-container .label {}
.custom-widget .widget-container .label.alt {}
.custom-widget .widget-container .icon {}- Home
- Installation
- Configuration
- Styling
- YASB CLI
- FAQ
- Widgets:
- Active Windows Title
- Applications
- Battery
- Bluetooth
- Brightness
- Cava
- CPU
- Clock
- Custom
- Github
- GlazeWM Binding Mode
- GlazeWM Tiling Direction
- GlazeWM Workspaces
- Home
- Disk
- Language
- Libre Hardware Monitor
- Media
- Memory
- Microphone
- Notifications
- Notes
- OBS
- Server Monitor
- Systray
- Traffic
- Taskbar
- Pomodoro
- Power Menu
- Recycle Bin
- Update Check
- Volume
- Wallpapers
- Weather
- WiFi
- WHKD
- Windows-Desktops
- Komorebi Control
- Komorebi Layout
- Komorebi Stack
- Komorebi Workspaces
- Writing Widget