Files
komorebi/mkdocs.yml
Csaba ea35d818a1 feat(bar): windows systray widget
A new System Tray widget has been added to komorebi-bar, bringing native
Windows system tray functionality directly into the bar.

Special thanks to the Zebar project and its contributors for developing
the systray-util crate library that makes Windows system tray
integration possible.

The widget intercepts system tray icon data by creating a hidden "spy"
window that mimics the Windows taskbar. When applications use the
Shell_NotifyIcon API to manage their tray icons, the widget receives the
same broadcast messages, allowing it to monitor all system tray activity
while forwarding messages to the real taskbar to avoid disruption.

Users can configure which icons to hide using flexible rules. A plain
string matches by exe name (case-insensitive). A structured object can
match on exe, tooltip, and/or GUID fields using AND logic. Each field
supports matching strategies from komorebi's window rules (Equals,
StartsWith, EndsWith, Contains, Regex, and their negated variants),
allowing precise filtering even when multiple icons share the same exe
and GUID. An info button opens a floating panel listing all icons with
their properties and copy buttons, making it easy to identify which
values to use in filter rules.

The widget fully supports mouse interactions including left-click,
right-click, middle-click, and double-click actions on tray icons.
Double-click support uses the LeftDoubleClick action from systray-util
0.2.0, which sends WM_LBUTTONDBLCLK and NIN_SELECT messages. It handles
right-aligned placement correctly by adjusting the rendering order and
toggle button arrow directions to maintain consistent visual appearance
regardless of which panel the widget is placed in.

Some system tray icons register a click callback but never actually
respond to click messages, effectively becoming "zombie" icons from an
interaction standpoint. The widget includes fallback commands for known
problematic icons that override the native click action with a direct
shell command (e.g. opening Windows Security or volume settings).

The implementation uses a background thread with its own tokio runtime
to handle the async systray events, communicating with the UI thread
through crossbeam channels. Icon images are cached efficiently using
hash-based keys that update when icons change. Rapid icon updates are
deduplicated to prevent UI freezing, and image conversion (RgbaImage to
ColorImage) is performed on the background thread to keep the UI
responsive.

The widget automatically detects and removes stale icons whose owning
process has exited, using the Win32 IsWindow API on a configurable
interval. A manual refresh button is also available for immediate
cleanup.

A shortcuts button can be configured to toggle komorebi-shortcuts by
killing the process if running or starting it otherwise. The refresh,
info, and shortcuts buttons can each be placed in the main visible area
or in the overflow section.
2026-03-21 12:35:39 -07:00

264 lines
8.5 KiB
YAML

copyright: Copyright © 2020-Present LGUG2Z
use_directory_urls: false
site_name: Komorebi
site_description: The Tiling Window Manager for Windows
repo_url: https://github.com/LGUG2Z/komorebi
repo_name: LGUG2Z/komorebi
docs_dir: docs
theme:
name: material
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: deep purple
accent: deep purple
toggle:
icon: material/weather-sunny
name: Switch to dark mode
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: deep purple
accent: purple
toggle:
icon: material/weather-night
name: Switch to light mode
features:
- content.action.edit
- content.action.view
- content.code.copy
- content.tabs.link
- navigation.footer
- navigation.indexes
- navigation.sections
- navigation.tabs
- navigation.top
- navigation.tracking
- search.highlight
- search.share
- search.suggest
- toc.follow
markdown_extensions:
- admonition
- pymdownx.highlight
- pymdownx.superfences
plugins:
- macros
- search
nav:
- Komorebi:
- About:
- index.md
- design.md
- Getting started:
- Installation: installation.md
- Example configurations: example-configurations.md
- Troubleshooting: troubleshooting.md
- Usage:
- usage/focusing-windows.md
- usage/moving-windows.md
- usage/stacking-windows.md
- usage/focusing-workspaces.md
- usage/moving-windows-across-workspaces.md
- Komorebi Configuration:
- Schema: https://komorebi.lgug2z.com/schema
- Komorebi Bar Configuration:
- Schema: https://komorebi-bar.lgug2z.com/schema
- Common workflows:
- common-workflows/komorebi-config-home.md
- common-workflows/autostart.md
- common-workflows/animations.md
- common-workflows/autohotkey.md
- common-workflows/borders.md
- common-workflows/stackbar.md
- common-workflows/remove-gaps.md
- common-workflows/ignore-windows.md
- common-workflows/force-manage-windows.md
- common-workflows/floating-applications.md
- common-workflows/tray-and-multi-window-applications.md
- common-workflows/mouse-follows-focus.md
- common-workflows/dynamic-layout-switching.md
- common-workflows/multiple-bar-instances.md
- common-workflows/bar.md
- common-workflows/bar-widgets/systray.md
- common-workflows/multi-monitor-setup.md
- CLI reference:
- cli/quickstart.md
- cli/license.md
- cli/start.md
- cli/stop.md
- cli/kill.md
- cli/check.md
- cli/configuration.md
- cli/bar-configuration.md
- cli/whkdrc.md
- cli/data-directory.md
- cli/state.md
- cli/global-state.md
- cli/gui.md
- cli/toggle-shortcuts.md
- cli/visible-windows.md
- cli/monitor-information.md
- cli/query.md
- cli/subscribe-socket.md
- cli/unsubscribe-socket.md
- cli/subscribe-pipe.md
- cli/unsubscribe-pipe.md
- cli/log.md
- cli/quick-save-resize.md
- cli/quick-load-resize.md
- cli/save-resize.md
- cli/load-resize.md
- cli/focus.md
- cli/move.md
- cli/preselect-direction.md
- cli/cancel-preselect.md
- cli/minimize.md
- cli/close.md
- cli/force-focus.md
- cli/cycle-focus.md
- cli/cycle-move.md
- cli/eager-focus.md
- cli/stack.md
- cli/unstack.md
- cli/cycle-stack.md
- cli/cycle-stack-index.md
- cli/focus-stack-window.md
- cli/stack-all.md
- cli/unstack-all.md
- cli/resize-edge.md
- cli/resize-axis.md
- cli/move-to-monitor.md
- cli/cycle-move-to-monitor.md
- cli/move-to-workspace.md
- cli/move-to-named-workspace.md
- cli/cycle-move-to-workspace.md
- cli/send-to-monitor.md
- cli/cycle-send-to-monitor.md
- cli/send-to-workspace.md
- cli/send-to-named-workspace.md
- cli/cycle-send-to-workspace.md
- cli/send-to-monitor-workspace.md
- cli/move-to-monitor-workspace.md
- cli/send-to-last-workspace.md
- cli/move-to-last-workspace.md
- cli/focus-monitor.md
- cli/focus-monitor-at-cursor.md
- cli/focus-last-workspace.md
- cli/focus-workspace.md
- cli/focus-workspaces.md
- cli/focus-monitor-workspace.md
- cli/focus-named-workspace.md
- cli/close-workspace.md
- cli/cycle-monitor.md
- cli/cycle-workspace.md
- cli/cycle-empty-workspace.md
- cli/move-workspace-to-monitor.md
- cli/cycle-move-workspace-to-monitor.md
- cli/swap-workspaces-with-monitor.md
- cli/new-workspace.md
- cli/resize-delta.md
- cli/invisible-borders.md
- cli/global-work-area-offset.md
- cli/monitor-work-area-offset.md
- cli/workspace-work-area-offset.md
- cli/toggle-window-based-work-area-offset.md
- cli/focused-workspace-container-padding.md
- cli/focused-workspace-padding.md
- cli/adjust-container-padding.md
- cli/adjust-workspace-padding.md
- cli/change-layout.md
- cli/cycle-layout.md
- cli/scrolling-layout-columns.md
- cli/flip-layout.md
- cli/promote.md
- cli/promote-swap.md
- cli/promote-focus.md
- cli/promote-window.md
- cli/retile.md
- cli/monitor-index-preference.md
- cli/display-index-preference.md
- cli/ensure-workspaces.md
- cli/ensure-named-workspaces.md
- cli/container-padding.md
- cli/named-workspace-container-padding.md
- cli/workspace-padding.md
- cli/named-workspace-padding.md
- cli/workspace-layout.md
- cli/named-workspace-layout.md
- cli/workspace-layout-rule.md
- cli/named-workspace-layout-rule.md
- cli/clear-workspace-layout-rules.md
- cli/clear-named-workspace-layout-rules.md
- cli/workspace-tiling.md
- cli/named-workspace-tiling.md
- cli/workspace-name.md
- cli/toggle-window-container-behaviour.md
- cli/toggle-float-override.md
- cli/toggle-workspace-window-container-behaviour.md
- cli/toggle-workspace-float-override.md
- cli/toggle-workspace-layer.md
- cli/toggle-pause.md
- cli/toggle-tiling.md
- cli/toggle-float.md
- cli/toggle-monocle.md
- cli/toggle-maximize.md
- cli/toggle-lock.md
- cli/restore-windows.md
- cli/manage.md
- cli/unmanage.md
- cli/replace-configuration.md
- cli/reload-configuration.md
- cli/watch-configuration.md
- cli/complete-configuration.md
- cli/window-hiding-behaviour.md
- cli/cross-monitor-move-behaviour.md
- cli/toggle-cross-monitor-move-behaviour.md
- cli/unmanaged-window-operation-behaviour.md
- cli/session-float-rule.md
- cli/session-float-rules.md
- cli/clear-session-float-rules.md
- cli/ignore-rule.md
- cli/manage-rule.md
- cli/initial-workspace-rule.md
- cli/initial-named-workspace-rule.md
- cli/workspace-rule.md
- cli/named-workspace-rule.md
- cli/clear-workspace-rules.md
- cli/clear-named-workspace-rules.md
- cli/clear-all-workspace-rules.md
- cli/enforce-workspace-rules.md
- cli/identify-object-name-change-application.md
- cli/identify-tray-application.md
- cli/identify-layered-application.md
- cli/remove-title-bar.md
- cli/toggle-title-bars.md
- cli/border.md
- cli/border-colour.md
- cli/border-width.md
- cli/border-offset.md
- cli/border-style.md
- cli/border-implementation.md
- cli/stackbar-mode.md
- cli/transparency.md
- cli/transparency-alpha.md
- cli/toggle-transparency.md
- cli/animation.md
- cli/animation-duration.md
- cli/animation-fps.md
- cli/animation-style.md
- cli/mouse-follows-focus.md
- cli/toggle-mouse-follows-focus.md
- cli/ahk-app-specific-configuration.md
- cli/pwsh-app-specific-configuration.md
- cli/convert-app-specific-configuration.md
- cli/fetch-app-specific-configuration.md
- cli/application-specific-configuration-schema.md
- cli/notification-schema.md
- cli/socket-schema.md
- cli/static-config-schema.md
- cli/generate-static-config.md
- cli/enable-autostart.md
- cli/disable-autostart.md