mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 00:08:04 +02:00
watchers: Add a new event on_color_scheme_preference_change
Fixes #8246
This commit is contained in:
@@ -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