Skip to content

Configuration

github-actions edited this page May 30, 2025 · 24 revisions

Config file

The configuration uses the YAML file format and is named config or config.yaml.

Valid directories for this file are C:/Users/{username}/.config/yasb/ or ENV variable YASB_CONFIG_HOME if set. A good starting point is the default config.

All valid options for the widgets are listed on the widgets page.

Environment Variables Support

YASB supports loading environment variables from a .env file.
This allows you to securely store sensitive information (such as API keys or tokens) outside of your main config.yaml.

  • The .env file should be placed in your config directory:
    C:/Users/{username}/.config/yasb/.env
    or in the directory specified by the YASB_CONFIG_HOME environment variable.
  • Variables defined in .env can be referenced in your config.yaml by setting the value to env (for example, api_key: env or api_key: "$env:YASB_WEATHER_API_KEY").
  • The .env file is loaded automatically on startup.

Example .env file:

YASB_WEATHER_API_KEY=your_api_key_here
YASB_GITHUB_TOKEN=your_github_token_here
YASB_WEATHER_LOCATION=your_location_here
# Some Qt settings
QT_SCREEN_SCALE_FACTORS="1.25;1"
QT_SCALE_FACTOR_ROUNDING_POLICY="PassThrough"

Status Bar Root Configuration

Option Type Default Description
watch_stylesheet boolean true Reload bar when style is changed.
watch_config boolean true Reload bar when config is changed.
debug boolean false Enable debug mode to see more logs

Komorebi settings for tray menu

Option Type Default Description
start_command string "komorebic start --whkd" Start komorebi with --whkd and default config location.
stop_command string "komorebic stop --whkd" Stop komorebi.
reload_command string "komorebic reload-configuration" Reload komorebi configuration.

Status Bar Configuration

Option Type Default Description
enabled boolean true Whether the status bar is enabled.
screens list ['*'] The screens on which the status bar should be displayed.
class_name string "yasb-bar" The CSS class name for the status bar.
alignment object {position: "top", center: false} The alignment settings for the status bar.
blur_effect object See below The blur effect settings for the status bar.
window_flags object See below The window flags for the status bar.
dimensions object {width: "100%", height: 36} The dimensions of the status bar.
padding object {top: 4, left: 0, bottom: 4, right: 0} The padding for the status bar.
animation object {enabled: true, duration: 500} The animation settings for the status bar. Duration is in milliseconds.
widgets list left[], center[], right[] Active widgets and position.
layouts object See below Configuration for widget layouts in each section (left, center, right).

Blur Effect Configuration

Option Type Default Description
enabled boolean false Whether the blur effect is enabled.
acrylic boolean false Whether to use an acrylic blur effect (Windows 10).
dark_mode boolean false Whether to enable dark mode and more shadow below the bar.
round_corners boolean false Whether to enable rounded corners for the bar. Note: This is only effective on Windows 11.
round_corners_type string 'normal' The type of rounded corners, can be normal or small. Note: This is only effective on Windows 11.
border_color string 'system' The border color for the bar, can be None, "system", or a hex color (e.g., "#ff0000"). Note: This is only effective on Windows 11.

Window Flags Configuration

Option Type Default Description
always_on_top boolean false Whether the status bar should always stay on top of other windows.
windows_app_bar boolean true Whether the status bar should behave like a Windows app bar.
hide_on_fullscreen boolean false Whether the status bar should hide when a window is in fullscreen mode.
auto_hide boolean false Whether the status bar should auto-hide when not in use.

Layouts Configuration

Each section (left, center, right) can be configured with the following properties:

Option Type Default Description
alignment string Section-dependent Widget alignment within section ("left", "center", "right")
stretch boolean true Whether widgets should stretch to fill available space

Example:

layouts:
  left:
    alignment: "left"
    stretch: true
  center:
    alignment: "center"
    stretch: true
  right:
    alignment: "right"
    stretch: true

Multiple Bars Example

Note: If you want to have different bars on each screen you will need to define on which screen the bar should be displayed, screens inside bar config is your monitor name. You can find your monitor name inside device manager or click on YASB tray icon and select Debug > Information to show all available screens.

bars:
  status-bar:
    screens: ['DELL P2419H (1)'] 
    widgets:
      left: ["clock"]
      center: ["cpu"]
      right: ["memory"]

  status-bar-2:
    screens: ['DELL P2419H (2)'] 
    widgets:
      left: ["active_window"]
      center: ["media"]
      right: ["volume","power_menu"]

widgets:
    ...
Clone this wiki locally