mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-12 19:49:32 +02:00
watchers: Add a new event on_color_scheme_preference_change
Fixes #8246
This commit is contained in:
@@ -93,6 +93,8 @@ Detailed list of changes
|
||||
|
||||
- Wayland niri: Fix 250ms delay on startup when using scale 1 (:iss:`8236`)
|
||||
|
||||
- :ref:`Watchers <watchers>`: Add a new event ``on_color_scheme_preference_change`` (:iss:`8246`)
|
||||
|
||||
|
||||
0.39.0 [2025-01-16]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -168,6 +168,13 @@ create :file:`~/.config/kitty/mywatcher.py` and use :option:`launch --watcher` =
|
||||
# data will contain is_start, cmdline and time.
|
||||
...
|
||||
|
||||
def on_color_scheme_preference_change(boss: Boss, window: Window, data: dict[str, Any]) -> None:
|
||||
# called when the color scheme preference of this window changes from
|
||||
# light to dark or vice versa. data contains is_dark and via_escape_code
|
||||
# the latter will be true if the color scheme was changed via escape
|
||||
# code received from the program running in the window
|
||||
...
|
||||
|
||||
Every callback is passed a reference to the global ``Boss`` object as well as
|
||||
the ``Window`` object the action is occurring on. The ``data`` object is a dict
|
||||
that contains event dependent data. You have full access to kitty internals in
|
||||
|
||||
Reference in New Issue
Block a user