Commit Graph
2612 Commits
Author SHA1 Message Date
LGUG2Z bdd811f2d4 refactor(bar): the macOS bar is a module of its package (move)
komorebi-for-mac/komorebi-bar/src/{bar,config,os}.rs and widgets/ move to src/macos/, main.rs to
macos/mod.rs (pub fn main); src/main.rs is a caller. Mechanical edits only: crate:: becomes
crate::macos:: (all sites), the include_str! path gets one more ../, and the unused root re-export of
komorebi_bar_core::platform is dropped.

Gates run: macOS fake-CC check of komorebi-bar-macos --locked --all-targets PASS (type check only); bar-core
schema oracle PASS; S/bar2 harness regenerates both bar schemas byte-identical to the checked-in files
(macOS 3774 lines, Windows 9091). Not run: any bar run on a Mac (the user's Mac check).
2026-10-31 12:41:55 -07:00
LGUG2Z 146cd7ff54 refactor(bar): the Windows bar is a module of the komorebi-bar package (move)
komorebi-bar/src/{bar,config,os}.rs and widgets/ move to komorebi-bar/src/windows/, main.rs to
windows/mod.rs (pub fn main); src/main.rs is a four-line caller. Mechanical edits only: crate:: becomes
crate::windows:: (all sites), the include_str! path gets one more ../, and the unused root re-export
of komorebi_bar_core::platform is dropped (the main installs the platform by its full path). This
prepares one package with a module per platform; behaviour is the same code.

Gates run: Windows clippy --all-targets -D warnings PASS; bar-core schema oracle (3 unit + 6) PASS; the
S/bar2 harness (real bar sources, regen.sh, updated to read src/windows) regenerates schema.bar.json for
Windows (9091 lines) and macOS (3774 lines) byte-identical to the checked-in files; tools/e2e-needed
says the bar is not an input of the e2e binaries. Not run: the bar itself, the screenshot gate (owed).
2026-10-31 12:41:00 -07:00
LGUG2Z b558acbe17 refactor(bar): the macOS bar uses the unified komorebi-client
komorebi-for-mac/komorebi-bar depends on komorebi-client (the one package, path ../../komorebi-client)
instead of komorebi-client-macos; same module, same API. Cargo.lock only rewires that edge.
Gates: macOS fake-CC check of komorebi-bar-macos --locked --all-targets PASS (type check only); bar-core
schema oracle (cargo test -p komorebi-bar-core: 3 unit + 6 oracle) PASS. Not run: any bar run.
2026-10-31 12:38:51 -07:00
LGUG2Z a73c9e2131 docs: state of the package migration (steps 0-6), the bar steps, the owed gates
Updates docs/dev/unified-binaries.md: steps 5 and 6 done, the limits found, step 7 for the bar written as
exact steps (B0-B4, not executed; bar files untouched), and the list of heavy builds, VM, e2e and Mac
checks the coordinator owes. Not verified: any nix build.
2026-10-31 12:35:48 -07:00
LGUG2Z 19162f3367 refactor(client): one komorebi-client package that re-exports the daemon of the target OS
The root komorebi-client package (0.1.42) is the one client: src/lib.rs is a cfg_select! over target_os
that re-exports the module of the platform. The three lib.rs files move to komorebi-client/src/{windows,
linux,macos}.rs (they were made equal in socket code by the previous revision), the KDE integration tests to
tests/linux_{daemon,subscribe}.rs (#![cfg(target_os = "linux")]). The daemon crate of each platform has a
dependency key of its own (cargo allows one path per key) and the module names it (use crate::komorebi_linux
as komorebi). The old komorebi-client-linux and komorebi-client-macos packages stay as shims that include
the moved module, so the old names build until the cutover (the macOS bar and komorebic-macos still use
them). komorebic now depends on the one komorebi-client on all three platforms. The KDE and macOS flakes
build the unified client (-p komorebi-client) and take its manifest, lib.rs and their module in the source
filter; the Windows filter leaves the other platforms' modules and tests out. Windows API for komorebi-bar,
komorebi-gui and komorebic is unchanged.

Gates run: Windows clippy --all-targets -D warnings PASS (client, bar, gui, komorebic); KDE cargo test -p
komorebi-client -p komorebi-client-linux -p komorebic -p komorebi-linux: 775 passed 0 failed (the client
tests and doctests included); cargo check of komorebic-linux and komorebi-client-linux PASS; macOS fake-CC
check --locked of komorebi-client, komorebic, komorebi-client-macos, komorebi-bar-macos, komorebic-macos
--all-targets PASS (type check only); CLI docs oracle byte-identical x3; nix evaluation PASS; by evaluation an
edit of komorebi-client/src/windows.rs changes only Windows derivations, linux.rs only kfde, macos.rs
neither. Not run: nix builds, the e2e (komorebi-client is in the closure of komorebi.exe's users: Windows e2e
OWED), any macOS link or run.
2026-10-31 12:34:59 -07:00
LGUG2Z e69346e918 refactor(client): the three komorebi-client crates have the same Connection
Windows and macOS had a Connection (messages written a line each in order); KDE had none, and Windows
opened it differently from macOS. All three now have the macOS text (open -> from_stream; KDE's with docs),
and the Windows DATA_DIR is exported like the other two. Additive on KDE and Windows, no change to what
any function does. Preparation for one komorebi-client package; the socket functions were already identical.

Gates run: Windows clippy --all-targets -D warnings PASS (client and its users); KDE cargo test -p
komorebi-client-linux (unit, integration, doctests) PASS. Not run: macOS (file untouched).
2026-10-31 12:24:30 -07:00
LGUG2Z d1539a0687 refactor(komorebic): move the macOS CLI into the unified komorebic package (pure move)
komorebi-for-mac/komorebic/src/main.rs and applications.json move to komorebic/src/macos/{mod.rs,
applications.json}; only the include_str! paths change (they point into komorebi-for-mac/docs) and
main is pub. The old package komorebic-macos stays and builds from the moved file through a shim
(src/main.rs includes ../../../komorebic/src/macos/mod.rs). komorebi-for-mac/komorebic/fixtures stays
where it is: the macOS daemon's pan tests read it. The macOS flake builds komorebic (unified) instead of
komorebic-macos and its source filter takes the unified package's manifest, build.rs, main.rs and
src/macos; the Windows filter already leaves macos out.

Gates run: macOS fake-CC check --locked of -p komorebic and -p komorebic-macos PASS (type check only);
Windows clippy PASS; KDE check PASS; CLI docs oracle byte-identical x3 (the macOS harness reads
komorebic/src/macos/mod.rs now); nix evaluation PASS, and by evaluation an edit of komorebic/src/windows.rs,
linux/mod.rs or macos/mod.rs changes only its own platform's derivations. Not run: nix builds, any macOS
link or run (the user's Mac check: komorebic --help, --version, quickstart, start, stop).
2026-10-31 12:22:20 -07:00
LGUG2Z d41cdc8979 refactor(komorebic): move the KDE CLI into the unified komorebic package (pure move)
komorebi-for-kde/komorebic/src/{main.rs,hotkeys.rs,applications.json} and tests/{check,cli,hotkeys}.rs
move to komorebic/src/linux/{mod.rs,hotkeys.rs,applications.json} and komorebic/tests/linux_*.rs
(#![cfg(target_os = "linux")]). The only edits are paths: include_str! and the tests' fixture and
repository-root paths point into komorebi-for-kde/ (docs, komorebi-hotkeys, schema files),
komorebi/tests/asc.rs reads the moved applications.json. The old package komorebic-linux stays and
builds from the moved file through a shim (src/main.rs includes ../../../komorebic/src/linux/mod.rs), so
the old name works until the cutover; its tests now run in the unified package. The KDE flake builds and
tests komorebic (unified) instead of komorebic-linux, its source filter takes the unified package's
manifest, build.rs, main.rs, src/linux and tests/linux_*; the Windows source filter leaves the Linux
and macOS files out. Comments and docs that name komorebic/src/main.rs or komorebic/tests/*.rs
(check.rs, ARCHITECTURE.md, scripts/compare-gen.py, the VM check suite) were not touched: they would
change the KDE derivations for text only.

Gates run: KDE cargo test -p komorebi-linux -p komorebic -p komorebic-linux -p komorebi-client-linux
-p komorebi-hotkeys --no-fail-fast: 888 passed, 0 failed (the moved komorebic tests included); Windows
clippy -D warnings PASS; macOS fake-CC check PASS; fast-check nix evaluation PASS; CLI docs oracle for
kde now generated by the unified komorebic: 166 pages, 0 diff, and its --help first line and --version
equal the old package's. Not run: nix builds (the KDE derivations changed), VM suites. Note: cargo
build/test of both komorebic and komorebic-linux in one command writes the same binary name twice
(use one of them).
2026-10-31 12:19:01 -07:00
LGUG2Z 2050b42f00 fix(komorebic): keep the help text of each platform
The unified komorebic package has one Cargo description, and the three CLIs read their about text from
env!("CARGO_PKG_DESCRIPTION"), so the Windows, KDE and macOS help would all have said the same. The text
is a literal in each platform module now, the one the old package had. Verified: see the next revisions
(komorebic --help of the unified Linux binary equals the old komorebic-linux one).
2026-10-31 12:11:41 -07:00
LGUG2Z 5660ad8f02 docs: record the state of the package migration (steps 0-4 done)
Adds the state, the measured cache isolation after the workspace merge and the limits found (stubbed
source is read at evaluation, so other systems' attributes need their own builder; deny/fmt/taplo of the
merged workspace unbuilt; steps 5 and 6 left for the cutover). Not verified: any nix build.
2026-10-31 12:10:04 -07:00
LGUG2Z a72b25dc89 refactor(komorebic): one komorebic package that builds the CLI of the target OS
The root komorebic package (version 0.1.42) is now the one komorebic: src/main.rs is a cfg_select! over
target_os that runs the CLI module of the platform. The Windows main is moved to src/windows.rs
(pub fn main); the Linux and macOS CLIs are included from where they live
(#[path = "../../komorebi-for-kde/komorebic/src/main.rs"], likewise macOS), so no file moves yet and
the old komorebic-linux and komorebic-macos packages still build from the same files. Dependencies are
in per-target tables; cargo allows one path per dependency key, so the Linux and macOS crates keep
their renamed keys and main.rs aliases them (extern crate komorebi_client_linux as komorebi_client).
The unified package needs no reqwest build dependency (committed applications.json) so it builds
natively on Linux without openssl. hotkeys.rs: crate::HOME_DIR -> super::HOME_DIR (same crate root in
the old package).

Gates run: Windows clippy --all-targets -D warnings PASS; KDE check + 294 lib + 5 schemas (old package)
PASS; macOS fake-CC check of -p komorebic --target aarch64-apple-darwin --locked --all-targets PASS (type
check only); native Linux cargo check/build of -p komorebic PASS and its docgen output is byte-identical
to the KDE oracle (166 pages, diff 0); CLI docs oracle byte-identical for windows, macos, kde
(S/step4/regen.sh reads komorebic/src/windows.rs now); nix eval of komorebic and the kfde packages OK.
Not run: nix builds, e2e (komorebic.exe inputs changed: Windows e2e gate OWED), any macOS link or run
(the user must check on a Mac: komorebic --help, --version, start, stop, state, docgen output).
2026-10-31 12:09:39 -07:00
LGUG2Z 80a749b37e build(nix): build the KDE and macOS packages from the root workspace
The three flakes now build from the one root Cargo workspace (previous revision, which must land with
this one). nix/workspace-src.nix assembles each platform's source: the files it needs (its crates, the
root crates they depend on, the root Cargo.toml and Cargo.lock) plus a stub (the member's own
manifest, an empty lib.rs, a main that does nothing) for every other member, because cargo has to load
the whole workspace but must not depend on the other platforms' code. The KDE and macOS flakes pass
-p <their packages> (cargoExtraArgs), no longer cd into a subdirectory workspace, use the root
Cargo.lock/Cargo.toml (vendored from the filtered source, so crane does not read the stubbed one),
and run cargo deny with --workspace --exclude <the other platforms' packages> and their own
deny.toml; the root flake excludes the KDE and macOS packages from deny and builds default-members.
komorebic/applications.json is added to the macOS source filter (it is embedded by include_str!).
The KDE/macOS deny.toml clarify entries and root deny.toml follow the package renames (squashed into
the rename revisions).

Evaluation (nix eval drvPath, no build): Windows clippy, deny, fmt, nextest, toml-fmt; kfde clippy,
doc, deny, fmt, toml-fmt, nextest, schema-fresh; kfde-komorebi, kfde-komorebic, komorebic. Cache
isolation measured by evaluation: an edit of crates/komorebi-bar-core or komorebi/src changes the
Windows drvs and leaves the kfde clippy and nextest drvs unchanged; an edit of komorebi-for-kde changes
kfde and leaves Windows unchanged; an edit of komorebi-for-mac changes neither. tools/kde-closure-check
ok (rewritten for the merged workspace), root-crates.json unchanged.

KNOWN LIMITS: (1) the stubbed source is a derivation that crane reads at evaluation (readDir in
mkDummySrc), so evaluating or building another system's attributes needs a builder for that system:
`nix flake show --all-systems` and drvPath of aarch64-darwin attributes now fail on a Linux host (the
fast-check nix step evaluates the current system only). (2) cargo deny, fmt and taplo behaviour in the
merged workspace is unverified: not built. (3) the version placeholder warning of crane for the
virtual root manifest (cosmetic).

Needs from the coordinator (idle host, heavy gates): nix build -L .#checks.x86_64-linux.komorebi-workspace-clippy
(the root deps derivation is a new one because of the lock), .#checks.x86_64-linux.komorebi-workspace-deny,
-fmt, -nextest, -toml-fmt; the same for kfde-komorebi-workspace-{clippy,deny,fmt,nextest,toml-fmt,doc},
kfde-schema-fresh, .#packages.x86_64-linux.kfde-komorebic and kfde-komorebi; then one KDE VM fast run
(the KDE package derivation changed); on a Mac or a darwin builder: .#packages.aarch64-darwin.kfm-komorebic,
kfm-komorebi, kfm-komorebi-bar and the kfm checks. Not run by me: any of these.
2026-10-31 12:06:27 -07:00
LGUG2Z 03072f4fdb build(workspace): merge the KDE and macOS crates into the root workspace
komorebi-for-kde/*, komorebi-for-mac/* crates become members of the root Cargo workspace: one
Cargo.lock (901 packages; the 859 Windows entries are unchanged, checked by name and version), the
two nested [workspace] manifests and lock files are deleted, their inherited dependencies are written
out per crate (script S/pkg-merge.py), KDE's .cargo/config.toml (COMMIT_HASH default) moves to the
root .cargo/config.toml (non-forcing, nix still wins). default-members is the Windows set, so a bare
cargo command (and crane, which passes no --workspace) builds only Windows crates; the KDE and macOS
crates are selected with -p. Crates only KDE used were re-resolved newer by cargo; pinned back to the
KDE lock (zbus, zbus_macros 6.1.0, zbus_utils 6.0.0, zruntime 0.2.1, sysinfo 0.40.0). Two small
differences remain: unicode-width 0.2.2 (KDE locked 0.2.3) and libz-sys 1.1.31 (macOS locked 1.1.30).

The root flake and the two nested flakes still read the old workspaces and do not evaluate at this
revision: they are fixed in the next one, which must land with this one (nix cannot be half-merged).
Not behaviour.

Gates run: Windows clippy --all-targets -D warnings (default-members) PASS; KDE check + 294 lib + 5
schemas PASS from the root workspace; macOS fake-CC check of the four macOS packages --locked PASS.
Not run: nix (broken until the next revision), VM, e2e. tools/fast-check now detects the merged
layout.
2026-10-31 11:51:10 -07:00
LGUG2Z 660e67b707 refactor(pkg): rename the Windows daemon package to komorebi-windows
The package name komorebi is needed for the single komorebi binary package (Option A of
docs/dev/unified-binaries.md). The daemon library becomes komorebi-windows with [lib] name and
[[bin]] name unchanged (komorebi); komorebi-client uses package = ...; the version lookup in the
justfile and cargo wix -p in the release workflow follow. Cargo.lock only renames one entry (checked).
Not behaviour: same sources, same binary name.

Gates run: fast-check --since base: Windows clippy PASS, KDE and macOS PASS, nix eval PASS.
tools/e2e-needed lists the e2e binaries as affected (the closure crate's manifest changed), so the
Windows e2e gate is OWED by the coordinator; the produced komorebi.exe should be unchanged code. Not
run: nix builds, e2e.
2026-10-31 11:51:10 -07:00
LGUG2Z 1be07fcdd7 refactor(pkg): suffix the KDE and macOS package names (komorebi-linux, komorebic-macos, ...)
The three trees are going to share one Cargo workspace, where package names must be unique. The
KDE packages become komorebi-linux, komorebic-linux, komorebi-client-linux and version-linux, the
macOS ones komorebi-macos, komorebic-macos, komorebi-client-macos, komorebi-bar-macos and
version-macos. Library and binary names do not change ([lib] name, [[bin]] name; dependents use
package = ...), so no source line changes and the binaries are still komorebi, komorebic and
komorebi-bar. Both Cargo.lock files only rename entries (checked: same name/version set otherwise).
The justfiles and the KDE flake (cargoExtraArgs) that name a package are updated here. Not behaviour.

Gates run: fast-check --since base: Windows clippy PASS, KDE check + 294 lib + 5 schemas PASS, macOS
fake-CC check --locked PASS, nix eval of both flakes PASS; KDE cargo test --workspace 879 passed 0
failed (tests/version.rs included); tools/kde-closure-check ok; CLI docs oracle byte-identical for
windows, macos and kde (S/step4/oracle-check.sh, now path-independent and name-aware). Not run: nix
builds, VM suites, e2e. Needed from the coordinator: nothing for the Windows daemon (not renamed
here); the KDE package derivations change name, so one KDE build/VM run will rebuild.
2026-10-31 11:51:10 -07:00
LGUG2Z 4e0a7171ec refactor(cli): name the komorebi and komorebi-bar commands explicitly
clap derives the command name from CARGO_PKG_NAME. The packages are about to be renamed
(komorebi-windows, komorebi-linux, komorebi-macos, komorebi-bar-macos) while the binaries keep
their names, so the name is written in #[clap(name = ...)] on the three daemons and the two bars.
komorebic already names itself in komorebic-core. Not behaviour: the names are the ones the
packages give now. Verified: KDE tests/version.rs is the test that reads the name (run in the
next revisions); fast-check below. Not verified: macOS and Windows runs.
2026-10-31 11:33:02 -07:00
LGUG2Z d6030db53d fix(nix): add komorebi-settings to the KDE source filter list
wip-u-nix narrowed the KDE source to the crates in the KDE cargo closure; the settings stack
(wip-stage) adds crates/komorebi-settings to that closure, so tools/kde-closure-check failed on the
merge of the two. Not behaviour. Verified: tools/kde-closure-check passes. Not verified: nix build.
2026-10-31 11:33:01 -07:00
LGUG2Z e71791399f build(komorebic): commit applications.json instead of fetching it in build.rs
The Windows and macOS komorebic embed applications.json with include_str!, and build.rs
downloaded it when missing (the files were git-ignored). A build script that needs reqwest, and
so openssl on Linux, cannot be part of one package that also builds there, and the download
made nix builds depend on a copy step. The two files are now committed, byte-identical to the
asc flake input (applications.json and applications.mac.json, checked with cmp); the Windows
build.rs keeps only shadow-rs; the macOS build.rs is gone. The flake preBuild copy of the input
file stays and is now a no-op. Not behaviour: same embedded bytes.

Verified: fast-check --since base: Windows clippy PASS, macOS fake-CC check PASS (--locked, so
Cargo.lock unchanged). Not verified: nix builds.
2026-10-31 11:32:40 -07:00
LGUG2Z 12870fa533 chore(repo): base for the package migration
Merge of wip-stage (kfde, bar, settings), wip-cand1 (kfw, kfm), wip-u-nix and wip-u-pkg (the
unified-binaries doc), so the migration is built on the open stacks and does not conflict with them later.
2026-10-31 11:31:14 -07:00
LGUG2Z 374269646e docs: unified komorebi, komorebic and komorebi-bar packages (layout, migration order, risks)
Records the spike (revisions on wip-u-pkg-spike, nothing landed on wip-main): one root
workspace holds the Windows, KDE and macOS crates with one Cargo.lock (+41 packages), the
unified komorebic builds on all three targets, KDE tests pass unchanged except one test
that reads the package name. Recommends komorebic and bar as one crate with cfg(target_os)
modules and the daemon as three gated libraries behind one thin binary, lists the migration
order, risks, gates (compile, S oracle, nix, e2e, KDE VM, Mac hand check) and the file moves
that conflict with the open wip-u-* stacks.

Verified: Windows cargo check -p komorebic, KDE check and 879 of 880 tests, macOS fake-CC
check, all on the spike tree. Not verified: nix builds, e2e, VM, any macOS link or run.
2026-10-31 11:27:53 -07:00
LGUG2Z 1b3b33fb2c chore(repo): combine the kfde, bar and settings stacks (staging)
Staging merge of three stacks that make no runtime change on Windows or KDE: the KDE Backend/Container/process_command refactors (wip-u-kfde), the shared bar core moves (wip-u-bar) and komorebi-settings with the S1/S2 pins (wip-u-settings). Conflicts, if any, are resolved here. Not yet gated: the KDE VM suites and the Windows bar check are owed.
2026-10-31 11:25:59 -07:00
LGUG2Z 495c4f2e0d feat(macos): install the settings handle
New module settings.rs: MacosSettings (empty platform part) and settings(),
a LazyLock<Handle<MacosSettings>> starting from Shared::defaults_for(
PlatformDefaults::MACOS). Nothing reads it yet, so nothing changes at
runtime. A test pins that the starting settings equal the starting values of
the statics (as for KDE); it is type-checked only, because macOS tests
cannot run on this host. Plan step 10, S2. Pure refactor.

Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin
--workspace --all-targets: 0 errors. The pin test was not run (no Mac).
2026-10-31 11:25:29 -07:00
LGUG2Z fe2febed56 refactor(macos): take the default constants from komorebi-settings
DEFAULT_RESIZE_DELTA, DEFAULT_MOUSE_FOLLOWS_FOCUS and the initial values of
DEFAULT_WORKSPACE_PADDING and DEFAULT_CONTAINER_PADDING now come from
komorebi_settings::shared (PlatformDefaults::MACOS); the statics keep their
names and types, so no reader changes. Adds the komorebi-settings path
dependency (Cargo.lock +1 package). Plan step 10, S1. Pure refactor: same
values (50, true, 5, 5). BORDER_OFFSET_ADJUSTMENT stays where it is: it is a
macOS-only constant (the platform part, later).

Verified: macOS fake-CC cargo check --target aarch64-apple-darwin
--workspace --all-targets: 0 errors (type-check only; nothing linked or run;
no Mac).
2026-10-31 11:25:29 -07:00
LGUG2Z b7b95320ee feat(kde): install the settings handle
New module settings.rs: KdeSettings (empty platform part) and settings(), a
LazyLock<Handle<KdeSettings>> starting from Shared::defaults_for(
PlatformDefaults::KDE). Nothing reads it yet, so nothing changes at runtime.
A test pins that the starting settings equal the starting values of the
statics (paddings, resize delta, mouse follows focus, border enabled/width/
offset/radius and the six colours), so that S3 and S6 can move each group
over without changing a default. Plan step 10, S2. Pure refactor.

Verified: KDE cargo test -p komorebi --lib --tests (lite env, own target
dir): all test binaries ok, 0 failed, including the new pin. KDE VM suites
not run.
2026-10-31 11:25:29 -07:00
LGUG2Z 3a287fcf0d refactor(kde): take the default constants from komorebi-settings
DEFAULT_RESIZE_DELTA, DEFAULT_MOUSE_FOLLOWS_FOCUS and the initial values of
DEFAULT_WORKSPACE_PADDING and DEFAULT_CONTAINER_PADDING now come from
komorebi_settings::shared (PlatformDefaults::KDE); the statics keep their
names and types, so no reader changes. Adds the komorebi-settings path
dependency (workspace and package manifest, Cargo.lock +1 package).
Plan step 10, S1 (docs/dev/settings.md section 5). Pure refactor: same
values (50, true, 5, 5), pinned by the crate's platform-defaults test.

Verified: KDE cargo test -p komorebi --lib --tests (lite env, own target
dir): all test binaries ok, 0 failed. KDE VM suites not run.
2026-10-31 11:25:29 -07:00
LGUG2Z fb145f96a8 feat(settings): add the shared settings and the load merge
Shared now holds every non-platform setting of docs/dev/settings.md 2.1:
border (enabled, width, offset, radius, six colours), animation (global and
per-prefix enabled, style, duration; fps; Animation::motion_for reading all
three from one snapshot), paddings and constants, transparency, floating
window aspect ratio, layout defaults, display index preferences, with the
per-platform defaults (PlatformDefaults::{WINDOWS, KDE, MACOS}: border 8/10/10
and -1/0/0, padding 10/5/5). SharedDelta::apply reproduces what
StaticConfig::apply_globals does with each key: absent keys keep the old value
(border, paddings, transparency, display preferences, a missing animation
block), absent layout_defaults and floating_window_aspect_ratio reset (the
latter to Standard although the static starts at Widescreen), an animation
block without fps resets fps, a global animation value clears its per-prefix
map and a map replaces the whole map.

No daemon uses the crate yet.

Verified: native cargo test -p komorebi-settings: 18 passed (9 handle, 9
shared: defaults per platform, default colours equal the komorebi-themes
conversion, keep-versus-reset per key, animation merge, motion_for);
clippy clean for the crate. The tests encode what apply_globals does as read
on wip-main; they were not run against the daemons.
2026-10-31 11:25:28 -07:00
LGUG2Z 1fb5e74fe3 feat(settings): add komorebi-settings with the snapshot handle
New crate crates/komorebi-settings (workspace member, Cargo.lock +1
package, no new third-party dependency). Settings<P> is a shared part and a
platform part P; Handle<P> holds the current value as an Arc that readers
snapshot once per unit of work and writers replace through update (writers
serialised, one publish, nothing published if the edit panics). Handle::scoped
sets one field and restores the previous value on drop only if the field
still holds the value it set, replacing the save-and-restore store pairs in
the daemons (Windows WINDOW_HANDLING_BEHAVIOUR, KDE ANIMATION_ENABLED_GLOBAL).
Shared starts with the border and the per-platform defaults; the rest follows
in the next revision. See docs/dev/settings.md.

No daemon uses the crate yet.

Verified: native cargo test -p komorebi-settings: 9 passed (snapshot
isolation, concurrent updates lose nothing, no torn reads under a writer,
scoped restore and 'change made meanwhile wins'); clippy clean for the crate.
komorebi-config warns about an unused import when built without its schemars
feature (not touched here). KDE, macOS and Windows trees not touched.
2026-10-31 11:25:28 -07:00
LGUG2Z 0a823eec94 docs(settings): inventory of the process-wide statics and the Settings design
Measured on wip-main 633e7453 by grep and reading: 126 (Windows), 53 (KDE)
and 74 (macOS) static declarations, of which 61/35/36 are configuration and
51/29/28 are written by apply_globals. The document has the per-static
table (type, writers, readers, shared or platform, matching name), the lock
order of the rule lists, the proposed Settings (shared part plus a platform
type parameter, snapshot reads, serialised updates, scoped override), the
statics whose semantics would change (reload merges rather than replaces;
partial updates visible mid-reload; save-and-restore writes; the empty
WORKSPACE_MATCHING_RULES window), the migration order with pure refactor
versus BEHAVIOUR marks and the gate each needs, and section 7 with the
findings from encoding the semantics in the crate (aspect ratio starts at
Widescreen but a load without the key writes Standard).

Verified: nothing run (documentation); counts from grep, line numbers read
at 633e7453.
2026-10-31 11:25:26 -07:00
LGUG2Z 5002989053 perf(nix): narrow the KDE source to its cargo closure
The KDE source filter took all of crates/, so an edit of
crates/komorebi-bar-core, which KDE does not depend on, changed every KDE
check and VM suite derivation. The filter now takes the nine crates of the
root workspace in the KDE cargo closure, listed in
komorebi-for-kde/nix/root-crates.json (read by the flake and by
tools/kde-closure-check, which fails if the list differs from
`cargo metadata` of the KDE workspace; a new dependency is therefore a
check failure, not a silent skip). The crates/ directory itself still passes
the filter so that its listed members are reached.

Safety: komorebi-gui, komorebi-bar and the e2e crates are already absent
from the KDE source while the root manifest lists them as members, so a
missing member directory is already tolerated. Not proven by a build.

Verified (nix eval of drvPath in a throwaway git copy, 7 commits): an edit
of crates/komorebi-bar-core leaves kfde clippy, nextest, the packages and
kfde-vm.stacks and .commands unchanged (before: all changed); an edit of
crates/komorebi-config changes them; the kfde package still evaluates.
tools/kde-closure-check passes, and fails when a crate is removed from the
list.
2026-10-31 11:22:17 -07:00
LGUG2Z 262f44d2b6 perf(nix): keep the VM library's unit tests out of the suites' source
komorebiVm (the python package every KDE VM suite imports) took all of lib/,
including lib/tests. The VM never runs those tests and setuptools does not
package them, but editing one changed komorebiVm and so rebuilt every suite
(34 of 34, about 50 min of the fast tier). It now takes lib/ minus lib/tests.
libCheck (vm-lib) keeps its own source, so the unit tests still run.

Verified (nix eval of drvPath in a throwaway git copy): an edit of
lib/tests/test_keys.py leaves kfde-vm.stacks and kfde-vm.commands unchanged
(before: both changed). Not verified by a build.
2026-10-31 11:22:15 -07:00
LGUG2Z f861a03adb perf(nix): stamp the commit only into the final Windows package
COMMIT_HASH was in commonArgs, so buildDepsOnly (about 1000 dependencies)
and every check (clippy, nextest, fmt, deny) got a new derivation for every
commit, even a docs-only one, and rebuilt in full.

commonArgs now carries the constant "nix-check" (as the KDE flake already
does) and only fullBuild, and so packages.default and the extracted
binaries, gets the real commit. The e2e build keeps its own constant through
the existing `commit` argument. Nothing the checks compile or test changes;
only the string shadow_rs stamps into the check binaries.

Verified (nix eval of drvPath in a throwaway git copy, 7 commits): the deps
derivation is identical for a docs edit, a Windows source edit, another docs
edit, a bar-core edit and a KDE-crate edit; clippy, nextest and fmt are
unchanged by the docs edit and change only for source edits;
packages.default changes with every commit (real commit embedded). Not
verified by a build: needs one idle-host nix build (commands in
tools/README.md).
2026-10-31 11:22:14 -07:00
LGUG2Z 6a548f4f62 docs: compare the KDE and Windows core model and propose komorebi-core
docs/dev/core-model.md: per-file measured differences between the
Windows, KDE and macOS container, monitor, workspace, window and
window_manager (stripped code lines, changed lines, identical lines),
the platform-specific fields and methods of each layer, a proposed
split into a komorebi-core crate generic over a Platform (Backend plus a
Copy-or-Clone Window and a state type) with the exact order of layers
(container, monitor, workspace, window_manager, router), what the KDE
stack of wip-u-kfde already did, what Windows must do before the crate
can be created, and the list of KDE process_command arms over 20 lines
with the method each became. Measurements are from diff of the files at
this tip; nothing was run on Windows or macOS.

Verified: not applicable (documentation); the numbers were produced by
diff and wc on the files at wip-u-kfde.
2026-10-31 11:09:17 -07:00
LGUG2Z be6cfab24c refactor(kde): query, configuration and border-colour commands are named methods
Plan step 9 prerequisite, last cluster of process_command: Query (51
lines) becomes answer_query(query, reply), ReplaceConfiguration (34)
becomes replace_configuration(config), BorderColour (21) becomes
set_border_colour(kind, r, g, b). After this no arm of KDE's
process_command is longer than 20 lines (the only longer one is the
list of not-supported messages, which has no logic). Bodies are the
arms' bodies, dedented. No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, FakeBackend):
633 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 11:08:13 -07:00
LGUG2Z 65c8e92b05 refactor(kde): rule commands of process_command are named methods
Plan step 9 prerequisite: SessionFloatRule (39 lines), IgnoreRule (55),
NamedWorkspaceRule (21) and InitialNamedWorkspaceRule (21) become
add_session_float_rule(), add_ignore_rule(identifier, id),
add_named_workspace_rule(identifier, id, workspace) and
add_initial_named_workspace_rule(identifier, id, workspace). Bodies are
the arms' bodies, dedented, plus Ok(()). No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, FakeBackend):
633 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 11:05:55 -07:00
LGUG2Z f1ff3d3df8 refactor(kde): resize and layout-ratio commands are named methods
Plan step 9 prerequisite: ResizeWindowAxis (60 lines) becomes
resize_window_axis(axis, sizing), LayoutRatios (23 lines) becomes
set_layout_ratios(columns, rows), and
ToggleWorkspaceWindowContainerBehaviour (21 lines) becomes
toggle_workspace_window_container_behaviour(). Bodies are the arms'
bodies, dedented, plus Ok(()). No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, FakeBackend):
633 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 11:04:02 -07:00
LGUG2Z 54d9f1c8c3 refactor(kde): EagerFocus and ToggleWorkspaceLayer are named methods
Plan step 9 prerequisite, next cluster of process_command: the 75-line
EagerFocus arm becomes WindowManager::eager_focus(exe) and the 90-line
ToggleWorkspaceLayer arm becomes toggle_workspace_layer(). Bodies are
the arms' bodies, dedented, plus Ok(()). No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, FakeBackend):
633 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 11:02:31 -07:00
LGUG2Z 683c1c4b0c refactor(kde): workspace-focus commands of process_command are named methods
Plan step 9 prerequisite: the multi-line arms of process_command become
methods of WindowManager. This cluster: CycleFocusWorkspace
(cycle_focus_workspace), CycleFocusEmptyWorkspace
(cycle_focus_empty_workspace), CloseWorkspace (close_workspace) and the
twin arms MoveContainerToLastWorkspace and SendContainerToLastWorkspace,
which were the same 27 lines but for the follow flag, now one method
move_container_to_last_workspace(follow). The bodies are the arms'
bodies, dedented, plus Ok(()). No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, FakeBackend):
633 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 11:00:21 -07:00
LGUG2Z 1c3221e6b6 docs(bar): status after the config move, merged package layout, macOS hand check
docs/dev/bar-unification.md is brought up to date: what the core holds now
(4,592 lines, the hooks), what is still per platform with fresh
measurements (komorebi.rs 136 differing lines, network.rs 82, bar.rs 444,
main.rs 92, os.rs 71) and why each stays, the known macOS/Windows
differences kept on purpose (including the accept-and-skip of Windows-only
keys, D-coord-1), the proposed layout of the merged package for the
coordinator (module layout with cfg(target_os), dependencies by target,
schema flag, lock-file folding, nix), the ordered plan and the hand check
list. No code changed. The macOS hand-check section for
docs/dev/macos-handcheck.md (owned by kfm, not in this tree) is in the
scratchpad as bar-handcheck-section.md for the coordinator to append.

Verified: figures from diff on this tree. Gates at this tip: native bar-core
tests 3+6, schema harness macOS and Windows byte-identical, Windows clippy
and macOS fake-CC check clean.
2026-10-31 10:57:18 -07:00
LGUG2Z 3603926f0e refactor(kde): order monitor.rs like the Windows monitor
Pure move, no behaviour change: struct Monitor first, then
impl_ring_elements!, then MonitorInformation and its From impl, as in
komorebi/src/monitor.rs. Field order and field sets are untouched (the
derive order is the JSON order of the state, and Windows' extra fields
name, device_id and workspace_names are content, not layout; see
docs/dev/core-model.md).

Verified: KDE cargo test -p komorebi --lib --tests (native): 633 passed,
0 failed. Not run: doc tests, VM suites.
2026-10-31 10:56:57 -07:00
LGUG2Z 91840eb34f refactor(bar-core): move the komorebi layout widget into the core
The two komorebi_layout.rs were identical except for the position of one
`pub use`. The widget moves to
crates/komorebi-bar-core/src/widgets/komorebi_layout.rs together with the
KomorebiLayoutExt trait; the shells re-export the module. Its three
komorebi_client calls go through the platform seam: new hook
`BarPlatform::send_komorebi_message` (next to send_komorebi_batch), which
both os.rs implement as `komorebi_client::send_message`, so each bar sends
exactly what it sent. DefaultLayout and SocketMessage come from
komorebi-layouts and komorebi-protocol (what komorebi_client re-exports).
About 290 lines per bar are gone.

Verified: native bar-core tests 3+6; schema harness macOS and Windows
byte-identical (3,774 / 9,091 lines); Windows clippy -D warnings --locked
clean; macOS fake-CC check --locked 0 errors (files touched first). Not
run: the bars; clicking the layout widget is unverified on both.
2026-10-31 10:56:04 -07:00
LGUG2Z ace81232a5 refactor(kde): container operations have the Windows signatures
Container::add_window takes the Window by value, and hide, restore and
load_focused_window return nothing (hide and restore take &self), as in
komorebi/src/container.rs. The KDE versions returned eyre::Result that
was always Ok (their docs said so) and callers wrote ? or unwrap on it;
those are gone, as is the eyre import of container.rs. Each operation
still does what it did: the same windows are hidden and restored in the
same order. No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, FakeBackend):
633 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 10:55:26 -07:00
LGUG2Z b65a32446e chore(repo): combine the kfw and kfm stacks for the e2e gate
Candidate for the Windows e2e gate: the Windows Backend switches and lock order (wip-u-kfw) with the macOS registry and Window methods (wip-u-kfm). Merge of two independent stacks that both touch crates/komorebi-backend; conflicts, if any, are resolved in this revision.
2026-10-31 10:55:01 -07:00
LGUG2Z ef89899bd9 refactor(bar-core): move config.rs (KomobarConfig and the mouse options) into the core
The (now identical) config.rs of both bars becomes
crates/komorebi-bar-core/src/config/komobar.rs; each shell config.rs is one
line, `pub use komorebi_bar_core::config::*;`. Import edits only: statics
from crate::statics, PathExt/SocketMessage from komorebi-protocol, Rect from
komorebi-layouts, the platform hooks and WidgetConfig as in the core. The
core gains komorebi-themes (KomobarTheme, Colour; schemars forwarded): one
line in each Cargo.lock. About 590 lines per bar are gone.

Because the configuration types are now all in the core, the oracle test
regenerates the macOS schema natively: the macOS view of
`schema_for!(KomobarConfig)` is byte-identical to
komorebi-for-mac/schema.bar.json (new test `generated`). Windows is still
compared by the out-of-tree harness: three descriptions in komorebi-protocol
and komorebi-themes read differently when compiled for Windows, which a
Linux test cannot do.

Verified: native bar-core tests 3 unit + 6 oracle (incl. the generated macOS
view); schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); Windows clippy -D warnings --locked clean; macOS fake-CC check
--locked 0 errors (core files touched first). Not run: the bars.
2026-10-31 10:54:51 -07:00
LGUG2Z afa7fcd219 refactor(mac-bar): converge config.rs onto the Windows source
komorebi-for-mac/komorebi-bar/src/config.rs is now a byte copy of the
Windows one. What that adds on macOS: the `mouse` options (MouseConfig,
MouseMessage, KomorebiMouseMessage), which were commented out; the Windows
spelling of the documentation (10 vs 10.0, the defaults sentence, `50` for
the height default and the root description naming the Windows release),
which the macOS schema view sets back; and one warning at load: a config
that sets `mouse` is accepted and the options are ignored with a logged
warning ("not supported on this platform") on every platform but Windows.

BEHAVIOUR (macOS): a macOS config with `mouse` options used to have them
ignored silently by serde (unknown key); it still ignores them, now with a
warning. The mouse commands cannot run on macOS: exec_shell_command answers
Unsupported and nothing in the macOS bar reads `mouse`.

Verified: schema harness macOS byte-identical (3,774 lines; the view removes
`mouse`, MouseConfig and the SocketMessage closure and resets the text) and
Windows byte-identical (9,091); Windows clippy -D warnings --locked clean;
macOS fake-CC check --locked 0 errors. Not run: the bars. Mac hand check:
start the bar with a config that has a `mouse` block and see the warning.
2026-10-31 10:53:10 -07:00
LGUG2Z 0ec3bc8399 refactor(kde): order container.rs like the Windows container
Pure move, no behaviour change: the impl blocks and methods of
komorebi-for-kde/komorebi/src/container.rs are in the same order as
komorebi/src/container.rs (hide, restore, load_focused_window,
idx_from_exe, contains_window, idx_for_window, remove_window_by_idx,
remove_focused_window, add_window, focus_window), impl_ring_elements!
follows the struct, the derive list and Default::default use the same
spelling. This makes the remaining differences (window id type, fallible
signatures) the only lines a diff shows. See docs/dev/core-model.md.

Verified: KDE cargo test -p komorebi --lib --tests (native): 633 passed,
0 failed. Not run: doc tests, VM suites.
2026-10-31 10:53:02 -07:00
LGUG2Z 7e61c3a934 refactor(bar): reach exec_powershell and send_batch through BarPlatform hooks
The mouse code in config.rs called `crate::bar::exec_powershell` and
`komorebi_client::send_batch` directly, which ties config.rs to the Windows
shell. Two new hooks, `exec_shell_command(&str)` and
`send_komorebi_batch(Vec<SocketMessage>)`, carry them: Windows os.rs calls
exactly `crate::bar::exec_powershell` and `komorebi_client::send_batch`;
macOS os.rs forwards send_batch the same way and answers
exec_shell_command with an Unsupported error (the macOS bar has no shell
session, and its mouse block was commented out), which nothing calls yet.
Windows behaviour is unchanged (same calls); config.rs of Windows now only
depends on the platform seam.

Verified: Windows clippy -D warnings --locked clean; macOS fake-CC check
--locked 0 errors (files touched first). Not run: the bars.
2026-10-31 10:52:09 -07:00
LGUG2Z 4831a6c3ab refactor(bar-core): WidgetConfig with a variant for every widget lives in the core
The widget configuration enum moves to widgets/widget.rs of the core with
all thirteen variants (Keyboard, Media and Systray are no longer cfg-gated
or commented out per tree), plus `supported()`/`unsupported()`/`enabled()`
(enabled is now false for a widget the platform cannot run) and
`warn_unsupported`, which both shells call when they read the config. The
construction of the widget from its config (`as_boxed_bar_widget`, which
needs the runtime types) becomes the extension trait `WidgetConfigExt` in
each shell widget.rs; macOS builds a no-op `Unsupported` for the three
Windows-only widgets, which `enabled()` never lets through.

BEHAVIOUR (macOS), per D-coord-1: a macOS config with a `Keyboard`, `Media`
or `Systray` widget is now accepted and skipped with a logged warning ("the
Keyboard widget is not supported on this platform and is skipped"); before
it failed to deserialize (unknown variant), so the whole bar config was
rejected. Mac hand check: such a config starts the bar and logs the
warning. The macOS schema view removes the three variants from the
schema, so komorebi-for-mac/schema.bar.json and the nix options do not
change.

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); native bar-core tests 3+5; Windows clippy -D warnings --locked
clean (re-run after touching the files: Checking komorebi-bar-core and
komorebi-bar); macOS fake-CC check --locked 0 errors. Not run: the bars.
2026-10-31 10:51:02 -07:00
LGUG2Z 42d8ea4656 refactor(kde): remove the Shared wrapper, KDE's Backend extends the shared one
komorebi-for-kde's Backend is now `trait Backend: komorebi_backend::Backend`
and declares only what is KDE's own: drag_origin and drag_end, apply_look,
set_border_colours, set_wallpaper and shutdown. The 26 operations that
have shared names and semantics (docs/dev/seam.md section 2.1) are the
shared trait's; KWinBackend and the KDE FakeBackend implement it directly
(supports() is true for every capability, batches are the default no-ops)
and the backend::shared module with its Shared<B> adapter is deleted. The
shared contract tests (check_all and the KDE-specific assertions) now run
against FakeBackend itself. Integration tests import the shared trait to
call the fake's operations.

No behaviour change. Coverage removed with the duplicated declarations:
the doc examples of the KDE set_opacity and set_focus_follows_mouse
(the fake tests and the shared contract still exercise both) and the
'id too wide for u32' wrapper test (the same rule is in KWinBackend raw()).

Verified: KDE cargo test --workspace --no-fail-fast, 878 passed, 0 failed
(native, FakeBackend; was 881 before this revision, the 3 removed tests
are the ones named above). Not run: KDE VM suites.
2026-10-31 10:50:39 -07:00
LGUG2Z a57648f36d refactor(bar-core): move the network widget config types into the core
NetworkConfig, NetworkSelectConfig, InterfaceDisplayType and
DefaultInterfaceConfig move to widgets/network_config.rs (the macOS file had
the first two without default_interface_options). The union NetworkConfig
therefore also has `default_interface_options` on macOS. The macOS schema
view already removes it from the schema, and serde ignored the key before,
so reading a config is unchanged; the macOS network widget now logs a
warning when the key is set ("not supported on macOS and is ignored").

BEHAVIOUR (macOS): one new log line when `default_interface_options` is
configured; nothing else. Needs no gate beyond the Mac hand check listed in
docs/dev/macos-handcheck.md.

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines; the macOS view is what removes the field); native bar-core tests
3+5; Windows clippy -D warnings --locked clean; macOS fake-CC check
--locked 0 errors.
2026-10-31 10:48:17 -07:00
LGUG2Z c2e6b01f89 refactor(bar-core): move the komorebi widget config types and KomorebiLayout into the core
The seven Komorebi*Config structs (komorebi.rs) and the KomorebiLayout enum
with its hand-written Deserialize and Display (komorebi_layout.rs) are data:
they move to crates/komorebi-bar-core/src/widgets/komorebi_config.rs, which
needs komorebi-layouts (DefaultLayout; schemars forwarded) and color-eyre
in the core: two lines in each Cargo.lock. The two shells re-export them.
The inherent impl of KomorebiLayout (is_default, on_click, show_icon, show,
the egui painting) cannot stay an inherent impl of a foreign type: it
becomes the extension trait `KomorebiLayoutExt` in each shell with the same
bodies; komorebi.rs imports the trait. Because the types are no longer in
the shell file, the two komorebi_layout.rs differ no more than the Windows
one; the macOS widget files keep their own komorebi.rs runtime.

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); native bar-core tests 3+5; Windows clippy -D warnings --locked
clean; macOS fake-CC check --locked 0 errors (core files touched first). I
reverted a stray `cargo fmt --all` that had reformatted unrelated files.
Not run: the bars.
2026-10-31 10:47:01 -07:00