mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-20 15:41:38 +01:00
padding (the border's 7 px), cloaking (and what stop does to it), the config file watch, the system's window tracking behind focus follows mouse, and a second display with a window sent to it. Each is run after the tiling windows as windows_<name>, its checks labelled [windows].
37 lines
1.3 KiB
Python
37 lines
1.3 KiB
Python
"""kfw watches the configuration file it was started with."""
|
|
|
|
import json
|
|
|
|
from komorebi_vm.core.checks import Checks
|
|
from komorebi_vm.core.platform import Client
|
|
|
|
from ..windows_platform import CONFIG_PATH, WindowsPlatform
|
|
|
|
|
|
def _config(name: str) -> dict:
|
|
return {"monitors": [{"workspaces": [{"name": name, "layout": "BSP"}]}]}
|
|
|
|
|
|
def _name(platform: WindowsPlatform) -> str | None:
|
|
return platform.state().monitors[0].workspaces[0].name
|
|
|
|
|
|
def run(platform: WindowsPlatform, checks: Checks, clients: list[Client]) -> None:
|
|
"""Starts the daemon from a file and changes the file on disk. The daemon
|
|
runs at the end, on the new file."""
|
|
platform.restart_with(_config("before"))
|
|
checks.check("the daemon starts with the name in the file", _name(platform) == "before")
|
|
|
|
changed = platform._out / "komorebi-changed.json"
|
|
changed.write_text(json.dumps(_config("after")))
|
|
platform._agent.put_file(changed, CONFIG_PATH)
|
|
checks.check(
|
|
"a changed file is read by the daemon on its own",
|
|
platform.wait_for(lambda: _name(platform) == "after", timeout=30),
|
|
)
|
|
platform.komorebic("replace-configuration", CONFIG_PATH)
|
|
checks.check(
|
|
"`replace-configuration` reads it again and the name stays",
|
|
platform.wait_for(lambda: _name(platform) == "after", timeout=10),
|
|
)
|