Commit Graph
2492 Commits
Author SHA1 Message Date
LGUG2Z 7cd85bd446 refactor(bar): memory, date and update use the platform hooks
The three widgets that differ between the bars only by a platform fact now read it from the hook, in both trees identically: memory opens the task manager through open_system_tool(TaskManager) (was cmd.exe /C taskmgr.exe on Windows, open -a 'Activity Monitor' on macOS: the same commands, now in each platform.rs); date takes its calendar glyph from calendar_icon() (CALENDAR_DOTS on Windows, CALENDAR on macOS); update polls latest_release_api_url() (the komorebi and komorebi-for-mac release APIs) and opens the release page through open_system_tool(Url(..)) (explorer.exe on Windows; on macOS the same explorer.exe it spawns today, broken there, unchanged). After this the memory.rs, date.rs and update.rs of the two bars are byte-identical.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; memory.rs, date.rs and update.rs byte-identical across the trees (diff). Note kept as it was: update.rs has a second GitHub API URL (the periodic refresh thread, line 85) that is the komorebi repo in both bars, also on macOS; only the first check goes through the hook. Not verified: clicks and the update check (no screen, no daemon).
2026-10-31 01:37:54 -07:00
LGUG2Z b8de056b28 refactor(bar-core): the cpu and battery widgets open their tools through the platform hook
The click on the cpu widget (task manager) and on the battery widget (power settings) now calls platform().open_system_tool(...) instead of spawning cmd.exe in shared code. The Windows hook spawns the same commands as before; the macOS hook still spawns the same (broken there) cmd.exe commands, so neither platform's behaviour changes. Fixing macOS is now a change to one function of komorebi-for-mac/komorebi-bar/src/platform.rs.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; native cargo test -p komorebi-bar-core 3 unit + 2 oracle passed; harness regeneration byte-identical for both. Not verified: that a click still opens the tool (no screen).
2026-10-31 01:37:54 -07:00
LGUG2Z 086833af96 refactor(bar-core): add the BarPlatform hooks with the Windows and macOS implementations
komorebi_bar_core::platform holds what the widgets need from the operating system and differs between the bars: BarPlatform { open_system_tool, latest_release_api_url, calendar_icon }, the SystemTool enum (task manager, power settings, network settings, a URL) and install()/platform(), a once-set global the shell fills first thing in main() (a widget calls platform() when it is clicked or built, never before main). Each bar gets an os.rs with its implementation (main.rs re-exports the core module as crate::platform, so shared files can say crate::platform::platform()): Windows spawns exactly the commands the widgets spawn today (cmd.exe /C taskmgr.exe, cmd.exe /C start ms-settings:batterysaver, cmd.exe /C ncpa, explorer.exe <url>); macOS maps TaskManager to open -a 'Activity Monitor' and network settings to open x-apple.systempreferences:... as memory.rs and network.rs do today, and keeps the commands the shared files spawn on macOS today for the rest (cmd.exe taskmgr.exe for cpu, cmd.exe start ms-settings:batterysaver for battery, explorer.exe for a URL), which are broken there: a one-line fix per tool in os.rs, not part of this change.

Nothing calls the hooks yet: the next revisions switch the widgets over, one concern each.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors (6 bar warnings, unchanged); native cargo test -p komorebi-bar-core 3 unit + 2 oracle passed; rustfmt --check clean on the new files and both main.rs. No widget calls the hooks yet, so no behaviour changes.
2026-10-31 01:37:54 -07:00
LGUG2Z 98f9e184a2 refactor(bar-core): move the battery and cpu widgets into komorebi-bar-core
Pure move of the two widget files that are byte-identical in the Windows and macOS bars. Each bar's widgets/mod.rs re-exports them (pub use komorebi_bar_core::widgets::battery / cpu), so crate::widgets::battery::... resolves as before; the files themselves are unchanged.

Dependencies: the core takes sysinfo from the root workspace (0.39) and starship-battery 0.11, the versions the Windows bar already used. The macOS bar therefore now gets these two widgets built against sysinfo 0.39 (its own workspace pins 0.38, still used by its other widgets until they move) and starship-battery 0.11 (was 0.10; its own dependency on the crate is removed). Both compile unchanged; behaviour of the libraries is not verified on macOS.

Not changed on purpose: the macOS bug that these two files spawn cmd.exe (taskmgr.exe, explorer.exe) on click is still there, identically; it is fixed behind the platform hook, not inside a move.

Removed: 325 lines from each bar (191 + 134), 325 added once.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors (bar warnings 6, unchanged; macOS Cargo.lock: starship-battery 0.10.3 -> 0.11.1 with its dependencies (uom, plist, nix), sysinfo 0.39.6 added next to 0.38.4); native cargo test -p komorebi-bar-core 3 unit + 2 oracle passed; harness regeneration (S/bar2/regen.sh, which now fails when a harness does not build): macOS byte-identical (3,774 lines), Windows byte-identical (9,091 lines). Not verified: rendering, sysinfo and starship-battery behaviour on macOS.
2026-10-31 01:37:54 -07:00
LGUG2Z c05ef98d77 refactor(bar-core): the BarWidget trait moves into komorebi-bar-core
The three-line trait every widget implements is split off widgets/widget.rs (the WidgetConfig enum stays there until every widget it names has moved) and becomes komorebi_bar_core::widgets::widget::BarWidget; each bar's widget.rs re-exports it, so crate::widgets::widget::BarWidget resolves as before. The core's config module re-exports the leaf types (crate::config::LabelPrefix) so that the widgets can later move without a text edit.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; native cargo test -p komorebi-bar-core 3 unit + 2 oracle passed. No schema type changed. Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z d5ad916ff1 refactor(bar-core): move render.rs into komorebi-bar-core
Pure move of render.rs (RenderConfig, Grouping, GroupingConfig, GroupingStyle, RoundingConfig and the helpers), byte-identical in both bars since the three previous revisions, with the one path edit the move needs: Alignment is imported from komorebi_bar_core::alignment instead of crate::bar. Each bar's main.rs re-exports the module (pub use komorebi_bar_core::render), so crate::render::... resolves as before.

Removed: 382 lines from each bar, 382 added once.

Note: the one added line is #[allow(clippy::new_without_default)] on RenderConfig::new, which clippy now asks for because the type is public API of a library crate.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; native cargo test -p komorebi-bar-core 3 unit + 2 oracle passed; harness regeneration: macOS byte-identical (3,774 lines), Windows byte-identical (9,091 lines). Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z 03d454de17 refactor(bar): the RenderExt impl for KomobarConfig moves from render.rs to config.rs
render.rs is about to move into komorebi-bar-core and must not know KomobarConfig. The only place it did was impl RenderExt for &KomobarConfig (the trait and RenderConfig stay in render.rs); that block, byte-identical in both bars, becomes the last item of config.rs with its imports. No behaviour change.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; rustfmt --check clean on both config.rs and render.rs. Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z a3afb3a94b refactor(bar): GroupingConfig.transparency_alpha has one spelling in render.rs
The two render.rs differed in two places. The Windows bar documented transparency_alpha with '(default: 200)' in its text; the macOS bar documented it without and put the default into the schema (schemars extend default 200), so the macOS nix options file gets default = 200. The macOS spelling is taken for both, because a change to the macOS schema.bar.json would also change the generated nix/komorebi-bar-options.nix, which cannot be regenerated here. Windows: the description loses the '(default: 200)' text and the property gains "default": 200 (reviewed diff of schema.bar.json below, pin updated in tests/schema_oracle.rs); the one comment on RenderConfig that only Windows had ('/// Render configuration') is added to the macOS copy. The two render.rs are then byte-identical.

The schema diff is the two lines of the property: description 'Alpha value for the color transparency [[0-255]] (default: 200)' -> 'Alpha value for the color transparency [[0-255]]', and one added "default": 200. macOS schema.bar.json is untouched (its harness regeneration is byte-identical).

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; native cargo test -p komorebi-bar-core: 3 unit + 2 oracle passed, 0 failed; harness regeneration: macOS byte-identical (3,774 lines), Windows byte-identical to the updated schema.bar.json (9,091 lines, diff exactly the two lines above). Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z 70bff5d549 refactor(bar): render.rs takes Colour and Rgb from komorebi-themes
komorebi_client::Colour and ::Rgb are re-exports of komorebi_themes::colour::Colour and ::Rgb in both trees; naming the crate that defines them lets render.rs move into komorebi-bar-core, which must not depend on komorebi_client (D25). Both bars' render.rs change identically. No behaviour change.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors. Types are the same re-exports, so no schema change. Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z 3b641c04ce refactor(bar-core): move the leaf types of config.rs and their three tests into komorebi-bar-core
Pure move of the tail of config.rs, which both bars have byte-identical: Position (with its Vec2 and Pos2 conversions), LabelPrefix, DisplayFormat, the extend_enum! macro, WorkspacesDisplayFormat, MediaDisplayFormat and the three extend_* unit tests, to komorebi_bar_core::config::types. Each config.rs re-exports the module (pub use komorebi_bar_core::config::types::*), so crate::config::LabelPrefix and the others resolve as before; the Windows config.rs keeps its own pub use of KomobarTheme.

Two differences, neither visible in a schema: the macOS bar had no MediaDisplayFormat (it has no media widget), so it now has the unused type; the unit tests count as 3 in komorebi-bar-core instead of 3 in each bar, and run natively on Linux. The bars take the crate's schemars feature from their own (komorebi-bar-core/schemars).

Removed: 170 lines from the Windows config.rs and 149 from the macOS one; 174 added once (170 moved, 4 import lines).

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors (bar warnings 6, unchanged); native cargo test -p komorebi-bar-core: 3 unit tests (the moved extend_* tests) + 2 schema oracle passed, 0 failed; harness regeneration (S/bar2/regen.sh): macOS byte-identical (3,774 lines), Windows byte-identical (9,090 lines). Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z c9d03e2ff4 refactor(bar-core): move the shared statics and Alignment into komorebi-bar-core
Pure move of what every bar module reads and nothing in it depends on: the monitor and label statics of main.rs (MAX_LABEL_WIDTH, MONITOR_LEFT/TOP/RIGHT/INDEX, BAR_HEIGHT, DEFAULT_PADDING, AUTO_SELECT_FILL/TEXT_COLOUR, and the Windows WIDGET_CLICKED flag with its two functions) and the three-variant Alignment of bar.rs. Each bar re-exports them (pub use komorebi_bar_core::statics::*, pub use komorebi_bar_core::alignment::Alignment), so crate::MAX_LABEL_WIDTH and crate::bar::Alignment resolve as before.

The only difference between the trees is that the macOS bar now also has the WIDGET_CLICKED flag and its two functions; nothing in the macOS bar calls them (only the Windows systray widget does), so there is no behaviour change.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; native cargo test -p komorebi-bar-core 2 passed, 0 failed. Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z 8ad6213b04 refactor(bar-core): move selected_frame.rs and ui.rs into komorebi-bar-core
Pure move of the two files of the bar that depend on nothing else in it, byte-identical in the Windows and macOS bars (selected_frame.rs since the previous revision). Each bar keeps its paths: main.rs re-exports the modules (pub use komorebi_bar_core::selected_frame / ui), so every crate::selected_frame::... and crate::ui::... in the widgets and bar.rs resolves as before. The crate takes eframe from the workspace; the macOS bar takes the crate by path.

Removed: 111 lines (89 + 22) from each of the two bars, 111 added once.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors (bar warnings 10 -> 6, the four strokes of the previous revision); native cargo test -p komorebi-bar-core 2 passed, 0 failed; harness schema regeneration (S/bar2/regen.sh): macOS byte-identical to its schema.bar.json (3,774 lines), Windows byte-identical to the regenerated schema.bar.json (9,090 lines). Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z a56a691d10 refactor(mac-bar): selected_frame.rs spells its strokes as the Windows bar does
The four Stroke::new(1.0, ...) calls become 1.0_f32, which is what the Windows copy has and what the compiler falls back to anyway (the f32: From<f64> fallback lint). Converge step before moving selected_frame.rs into komorebi-bar-core: afterwards both copies are byte-identical. No behaviour change.

Verified: macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors; the bar's warnings went from 10 to 6 (the four f32 literal fallbacks in this file are gone); macOS schema regeneration (harness) still byte-identical. Not verified: rendering.
2026-10-31 01:37:54 -07:00
LGUG2Z eaf43a2ca4 build(bar-core): add the komorebi-bar-core crate with the schema oracle test
Skeleton of the shared bar crate (D25/D26): an empty library and the oracle that every later move of bar code is held to. tests/schema_oracle.rs pins the checked-in schema.bar.json of the Windows bar (9,090 lines, FNV-1a 0x557301341968bff9) and of the macOS bar (3,774 lines, 0xc99e02949424e5d7), so any change to either file, intended or not, fails the test until the pin is updated in a reviewed revision. Once config.rs moves into the crate the test generates the schema and compares it with the file instead.

The pins are of the files as they are after the previous revision (the regenerated Windows file) and are the values the out-of-tree harness (S/bar2/regen.sh over the real sources) reproduces: macOS byte-identical, Windows byte-identical to the regenerated file.

Verified: native cargo test -p komorebi-bar-core: 2 passed, 0 failed; Windows cargo clippy --workspace --locked --all-targets -D warnings clean; macOS fake-CC cargo check --locked --workspace --all-targets finished, 0 errors.
2026-10-31 01:37:54 -07:00
LGUG2Z c5949d20ef docs(bar): regenerate the Windows schema.bar.json after step 2
Step 2 put SocketMessage in komorebi-protocol, so the Windows bar schema (reached through MouseConfig.message) changed. The file was regenerated with the harness that reproduced the old file byte for byte except for the State closure (S/bar2/regen.sh: real config.rs, render.rs, selected_frame.rs, ui.rs and widgets over the real komorebi-protocol, komorebi-layouts and komorebi-themes with the Windows cfgs on).

Diff, 10,552 -> 9,090 lines, all from step 2 (D15, D16, D27):
- State is now the opaque StateBlob (object, no properties) and the 31 defs only reachable through it are gone: Column, ColumnSplit, ColumnSplitWithCapacity, ColumnWidth, Container, CustomLayout, FloatingLayerBehaviour, GridLayoutOptions, IdWithIdentifier, InitialWindowPlacementRules, Layout, LayoutOptions, MatchingRule, Monitor, PlacementMatchingRules, PlacementTarget, Ring, Ring2-4, ScrollingCentering, ScrollingLayoutOptions, ThemeOptions, ThemeVariant, Wallpaper, Window, WindowContainerBehaviour, WindowPlacement, Workspace, WorkspaceConfig, WorkspaceLayer.
- SocketMessage gains ReloadHotkeys and HotkeysState (the unified enum) and a description; DebugWindow is int64 (was int).
- Descriptions added to State, StateQuery, SubscribeOptions; WindowKind description reworded.
Nothing in the bar's own types changed. The macOS file regenerates byte-identical (3,774 lines) and is not touched.

Verified: S/bar2/regen.sh (macOS cmp identical; Windows differs only by the items above, checked with jq after deleting the 31 defs from the old file). Not verified: against a real Windows komorebi-bar --schema run (cannot run here).
2026-10-31 01:37:54 -07:00
LGUG2Z e950c8f967 chore(repo): combine step 3 with the integration line
Merge revision: wip-main (history merges, fixes, step 0, steps 1, 2, 4 and 5, flake work, seam document) and wip-step3 (komorebi-config: matching types, behaviour enums, AspectRatio/PerAnimationPrefixConfig, asc and the application configuration data, placement types, the one StaticConfig with per-platform schema views, the daemons wired to it). Conflicts between step 3's edits and step 4's restructuring of komorebic (the schema-printing arms moved into the WindowsCommands/MacosCommands/KdeCommands matches) and in the Cargo.lock files are resolved here once, instead of through 35 separate rebases.
2026-10-31 01:37:54 -07:00
LGUG2Z fb545cf7a4 test(komorebic-core): the macOS pages in docs/cli are what the command line renders
Renders the macOS command line through komorebic-core (it needs no macOS to do it) and compares every page with komorebi-for-mac/docs/cli after the page transform macOS uses (a heading, 'Usage: komorebic <name>'), and the number of pages. It found the four macOS pages that step 2 left stale (the previous revision regenerates them) and keeps all 158 in step from now on. The test returns early when the macOS tree is not in the source (the nix build of the Windows workspace).

Verified: native cargo test -p komorebic-core --test docs_cli: 1 passed.
2026-10-31 01:37:54 -07:00
LGUG2Z 5763df9f73 feat(config): the platform table, read from the markers of the one StaticConfig
platforms::reads(platform, key) says whether a platform reads a top-level key and platforms::unsupported_keys(raw, platform) lists the keys of a configuration text that are keys of komorebi.json but that the platform does not read, which is what a daemon can say at load time instead of dropping them silently. The table is the x-komorebi-platforms markers themselves, so a key cannot be added without saying who reads it. The daemons do not call it yet: reporting at load time is a visible change of behaviour for the user's decision.

The oracle test checks the table against the three checked-in schemas (every key of a tree's schema.json is read by that platform) and on examples.

Verified: native cargo test -p komorebi-config: 4 unit + 9 schemas + 1 doctest passed, 0 failed (tier 1).
2026-10-31 01:37:54 -07:00
LGUG2Z f84a941795 docs(komorebic): regenerate the four macOS pages that step 2 changed
Step 2 moved SocketMessage into komorebi-protocol and unified its doc comments, so four macOS pages under komorebi-for-mac/docs/cli changed (animation, border-colour and two more; 26 insertions, 10 deletions). Regenerated with the docgen oracle (S/step4/oracle-check.sh) so the checked-in pages match what the command line renders. Verified: oracle-check reports the macOS pages identical.
2026-10-31 01:37:54 -07:00
LGUG2Z 657360d358 refactor(windows): use StaticConfig and its family of komorebi-config
static_config re-exports StaticConfig, WorkspaceConfig, MonitorConfig, BorderColours, ThemeOptions, Wallpaper, AnimationsConfig, AppSpecificConfigurationPath, TabsConfig and StackbarConfig from komorebi-config and loses their definitions, the end_of_life/aliases/deprecated notices and read_raw/read (about 650 lines). The inherent impl StaticConfig cannot stay in the daemon (orphan rule): apply_globals is a private trait (ApplyGlobals) and preload, postload and reload are the public extension trait StaticConfigExt, bodies unchanged; process_command, window_manager and main import the trait (komorebic only calls read and the notices, which are inherent in the crate, so it is untouched). The From<&WindowManager> and From<&Monitor> conversions fill the keys Windows never writes (border_radius, titleless_applications, tabbed_applications, window_hiding_position) with None or Default. The five #[deprecated] attributes of the old fields are gone (the schema marker replaced them; see the crate).

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings: clean (tier 2); the oracle test proves the Windows view of this StaticConfig equals schema.json byte for byte. Not verified: Windows unit tests (cannot run), running komorebic.exe or the daemon.
2026-10-31 01:37:54 -07:00
LGUG2Z 72dc31452f docs(komorebic): regenerate the pages of the fifteen commands whose help was unified
docs/cli of the three trees for the commands the previous revision unified, written the way each tree writes its pages: komorebi-for-kde 6 pages (colour/behaviour spelling), komorebi-for-mac 7 (the shorter scrolling descriptions), the Windows tree 2 (eager-focus, promote-focus). The Windows docs/cli is otherwise stale (older clap output, three pages missing; found in step 4 prep) and the other pages are left alone.

Verified: the KDE pages are byte-identical to komorebic docgen (166 of 166 against the real binary); the macOS and Windows pages are the docgen-all output with the same page transform that made 158 of 158 macOS pages identical before. Diffs are two-line spelling or description changes (see the previous revision).
2026-10-31 01:37:54 -07:00
LGUG2Z 15e6498a9e refactor(windows): use the placement types of komorebi-config
core re-exports WindowPlacement, PlacementTarget, PlacementMatchingRules and InitialWindowPlacementRules from komorebi-config and loses the local definitions and impls (about 230 lines) with the imports they alone needed. PlacementTarget is now the crate's copy (the KDE one): it parses the same values (a name, a number, or numeric text) and only the wording of its error for a bad value differs; the schema text Windows checked in for it is part of the Windows view of komorebi-config (changes.rs), which printing already uses.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings: clean (tier 2). Not verified: Windows unit tests (cannot run).
2026-10-31 01:37:54 -07:00
LGUG2Z 6dbcfdf1f3 refactor(komorebic-core): fifteen subcommands whose help differed join Messages with one help text
border-colour, monocle-focus-behaviour, toggle-monocle-focus-behaviour, toggle-window-container-behaviour, toggle-workspace-window-container-behaviour, unmanaged-window-operation-behaviour, scrolling-layout-columns, scrolling-layout-full-width, expel, retile, center-focus, consume, toggle-column-stack, eager-focus and promote-focus had the same arguments, flags and messages in the three trees and only their help text differed. They move into Messages (and out of WindowsCommands, MacosCommands and the KDE komorebic with their arms and argument structs) with ONE text each: the Windows text, except for eager-focus and promote-focus, where the wording two of the trees shared wins ('executable', 'largest window container').

The page diff against the pre-move output is docs only (reviewed, kept in the progress log): KDE says colour and behaviour instead of color and behavior in six pages; Windows eager-focus and promote-focus change a phrase; macOS loses the longer descriptions it had for center-focus, consume, expel, retile and toggle-column-stack and the three of its scrolling pages that differ from the Windows wording get the Windows text. Nothing that changes behaviour (flags, defaults, possible values, aliases) differs. The longer macOS descriptions make claims about the other layouts and about retile that were not checked for the Windows and KDE daemons, so the shorter text was kept; restoring them is a one-revision change to messages.rs. data-directory, disable-autostart, log (platform facts: paths, shortcuts, komorebi.exe), enable-autostart, start, stop and pan stay in the platform enums.

Verified: oracle compare: only the pages above differ (windows 2, macos 7, kde 6 of 187/158/166); native cargo test -p komorebic-core 34 passed; KDE cargo test -p komorebic --locked 80 passed; macOS fake-CC cargo check --locked 0 errors; Windows clippy --workspace --locked --all-targets -D warnings clean.
2026-10-31 01:37:54 -07:00
LGUG2Z 93e4d51108 refactor(mac): use StaticConfig and its family of komorebi-config
static_config re-exports StaticConfig, WorkspaceConfig, MonitorConfig, BorderColours, ThemeOptions, Wallpaper, AnimationsConfig and AppSpecificConfigurationPath from komorebi-config and loses their definitions, read_raw and read (about 410 lines). The inherent impl StaticConfig cannot stay in the daemon (orphan rule): apply_globals is a private trait (ApplyGlobals) and preload, postload and reload are the public extension trait StaticConfigExt (the macOS preload keeps its run_loop parameter), bodies unchanged; process_command, window_manager and main import the trait. The From conversions stay and fill the keys macOS never writes with None or Default.

Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin --workspace --all-targets: finished, 0 errors, no warnings in komorebi (tier 2). Not verified: macOS unit tests (cannot run), running komorebic.
2026-10-31 01:37:54 -07:00
LGUG2Z a686b61916 refactor(komorebic-core): animation, animation-duration and animation-style join Messages
The three animation subcommands were listed as differing in arguments between the trees because the possible values of --animation-type came from three different AnimationPrefix enums. Since step 2 there is one, and the pages of the three trees are now the same text (checked by comparing the rendered pages without fences and widths), so the Windows definitions move into Messages and the copies in WindowsCommands, MacosCommands and the KDE komorebic go, with their arms. The pages are byte-identical to the oracle: this is a move, not a docs change.

Verified: oracle: windows 187, macos 158, kde 166 pages byte-identical; native cargo test -p komorebic-core: 31 + 3 passed; KDE cargo test -p komorebic --locked: 80 passed; macOS fake-CC cargo check --locked: 0 errors; Windows clippy --workspace --locked --all-targets -D warnings clean.
2026-10-31 01:37:54 -07:00
LGUG2Z 857e14320e refactor(kde): use StaticConfig and its family of komorebi-config
static_config re-exports StaticConfig, WorkspaceConfig, MonitorConfig, BorderColours, ThemeOptions, Wallpaper, AnimationsConfig and AppSpecificConfigurationPath from komorebi-config and loses their definitions, read_raw and read (about 480 lines). The inherent impl StaticConfig can no longer exist in the daemon (orphan rule): its apply_globals is a private trait (ApplyGlobals) and preload, postload and reload are the public extension trait StaticConfigExt, with the bodies unchanged; callers import the trait (process_command, window_manager, main and the integration tests that call StaticConfig::preload, postload or reload: one added use line each, no assertion touched). The From<&WindowManager> and From<&Workspace> conversions stay (a reference to a local type is local) and fill the keys KDE never writes with None or Default.

Two places read the schema of StaticConfig to know which keys are read; the one type now carries every platform's keys, so they ask for the KDE view: the unknown-key diagnostic (check.rs known_keys) and the test config_parity (keys_that_are_read: only its source of the key list changed, the assertions are the same).

Verified: KDE cargo test --workspace --no-fail-fast -- --test-threads=1: 876 passed, 0 failed, 80 binaries (baseline 891: 4 unit tests moved to komorebi-config with the matching types, doc tests 45 -> 41 as examples moved; the other 7 are not itemised); komorebic static-config-schema and application-specific-configuration-schema byte-identical to the checked-in files. Windows and macOS untouched by this revision.
2026-10-31 01:37:54 -07:00
LGUG2Z d7282f76de refactor(komorebic): the Windows start and stop use the Launcher skeleton of komorebic-core
start becomes a WindowsLauncher (the PowerShell script, its printing of the script or the error, the process lookup by name komorebi.exe, the run in front of the user) around komorebic_core::launcher::start; the preflight for whkd, masir and ahk, the script building, the companions and the validation epilogue stay in the arm, and stop sends launcher::stop_message (its companions and force-quit are untouched). 'Waiting for komorebi.exe to start...' now has a trailing space and is flushed, as KDE's was.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean. Not verified: running komorebic start on Windows (no Windows guest run).
2026-10-31 01:37:54 -07:00
LGUG2Z f605a555e7 refactor(config): add read, read_raw and the load notices to StaticConfig
read_raw and read are identical in the three daemons (KDE's docs and doctest are taken); end_of_life, aliases and deprecated are the Windows pure string checks that print what a configuration file should change. None of them touches a window manager, so they live next to the type; the daemons' own inherent impls cannot (the orphan rule), they become an extension trait in the wiring revisions.

Verified: native cargo test -p komorebi-config: 4 unit + 8 schemas + 1 doctest passed, 0 failed (tier 1).
2026-10-31 01:37:54 -07:00
LGUG2Z 1e902542c7 refactor(komorebic): the macOS start and stop use the Launcher skeleton of komorebic-core
start becomes a MacosLauncher around komorebic_core::launcher::start; the companion bar and the licence text after it stay as they were, and stop sends launcher::stop_message. The odd '--config' arguments macOS passes are kept as they were. 'Waiting for komorebi to start... ' is now flushed as KDE's was (the text is the same).

Verified: macOS fake-CC cargo check --locked --workspace --all-targets: 0 errors. Not verified: running komorebic start on macOS.
2026-10-31 01:37:54 -07:00
LGUG2Z 13c0e2faba refactor(themes): make the nine stackbar theme fields unconditional
KomorebiThemeBase16, KomorebiThemeCatppuccin and KomorebiThemeCustom carried stackbar_focused_text, stackbar_unfocused_text and stackbar_background under cfg(target_os = "windows"), so what a Linux or macOS build accepted (and what its schema said) depended on the compile target: a Linux build could not even generate the Windows schema. komorebi-config needs one set of types, so the nine cfg attributes are removed. The KDE and macOS schemas keep their bytes because their views remove the fields again (changes.rs, applied after pruning); the Windows tree is unchanged.

Consequences, all mechanical: the places in KDE and macOS that build a KomorebiThemeCustom, KomorebiThemeCatppuccin or ThemeOptions by name (workspace.rs in both, two KDE tests and a komorebi-client test) now say stackbar_*: None, which keeps what they meant. A KDE or macOS komorebi.json that sets one of the three keys in a theme is now accepted and ignored instead of ignored as an unknown key. The macOS bar's own schema (komorebi-for-mac/schema.bar.json) will gain the three fields when it is next generated; it cannot be regenerated on this host and is left for step 4b, whose per-platform view takes care of it.

The oracle test now compares the Windows view too: all three views of StaticConfig are byte-identical to the checked-in schema.json files (Windows 141169, KDE 127164, macOS 120057 bytes).

Verified: native cargo test -p komorebi-config: 4 unit + 8 schemas passed, 0 failed; Windows cargo clippy --workspace --locked --all-targets -D warnings clean; KDE cargo check --workspace --all-targets clean (after the wallpaper test fix), komorebic output byte-identical to schema.json and schema.asc.json; macOS fake-CC cargo check --workspace --all-targets: 0 errors. Not verified: macOS and Windows unit tests, schema.bar.json of either bar.
2026-10-31 01:37:54 -07:00
LGUG2Z a2fa30acdc refactor(komorebic): the KDE start and stop use the Launcher skeleton of komorebic-core
start becomes a KdeLauncher (the Command for komorebi, the process lookup by exact name, the run in front of the user) around komorebic_core::launcher::start, which has the attempt loop; stop sends launcher::stop_message. The text printed and the commands run are the same.

Verified: KDE cargo test -p komorebic --locked: 10 + 12 + 49 + 9 passed, 0 failed; oracle kde 166 of 166 pages. Not verified: an actual komorebic start against komorebi (no test starts the daemon).
2026-10-31 01:37:54 -07:00
LGUG2Z dec9198492 refactor(mac): print the macOS view of the schema of komorebi-config
komorebic static-config-schema and the daemon's StaticConfigSchema answer print schema::view::<StaticConfig>(Platform::CURRENT) of the shared crate instead of the schema derived from the daemon's own StaticConfig; the oracle test proves the macOS view equals schema.json byte for byte.

Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin --workspace --all-targets: finished, 0 errors (tier 2). Not verified: running komorebic or the macOS tests.
2026-10-31 01:37:54 -07:00
LGUG2Z be3d1cd6b6 refactor(komorebic-core): the Launcher skeleton for start, and the stop message
start is the same dance in all three komorebic: look whether komorebi is running, start it, wait three seconds and look again, give up after three attempts by running it in front of the user so its stderr can be read. launcher::start runs that loop over a Launcher (daemon_name, spawn, is_running, diagnose) that each platform implements by hand; what follows a successful start (companions, the licence text) stays in each komorebic, as does stop's handling of companions, whose order differs per platform; only stop_message(ignore_restore) is shared. The loop flushes standard output after 'Waiting for ... to start...' (KDE did, macOS and Windows did not) and puts the same space after it; both are invisible in the text printed. Nothing uses it yet.

Verified: native cargo test -p komorebic-core: 31 passed, 0 failed (4 new launcher tests with a fake launcher: already running, second try, three tries then diagnose, stop message).
2026-10-31 01:37:54 -07:00
LGUG2Z 82ee9dd13a refactor(kde): print the KDE view of the schema of komorebi-config
komorebic static-config-schema and the daemon's StaticConfigSchema answer print schema::view::<StaticConfig>(Platform::CURRENT) of the shared crate instead of the schema derived from the daemon's own StaticConfig.

Verified: KDE cargo check --workspace --all-targets: no warnings; cargo test -p komorebi --lib: 289 passed, 0 failed; --test schemas: 5 passed; komorebic static-config-schema and application-specific-configuration-schema: byte-identical to the checked-in schema.json and schema.asc.json (no diff).
2026-10-31 01:37:54 -07:00
LGUG2Z 0345fccba2 refactor(komorebic): the macOS komorebic uses the pan module of komorebic-core
komorebi-for-mac/komorebic/src/pan.rs (810 lines) is deleted: it differed from the Windows copy by three doc comments only (whkd wording versus a generic one, 21 changed lines), so the shared module keeps the Windows wording of those comments; no code differs. pan --stream runs komorebic_core::pan with a PanLink over the client connection.

Verified: macOS fake-CC cargo check --locked --workspace --all-targets: 0 errors. The 16 pan tests of the macOS tree were the same tests as Windows'; they run in komorebic-core (27 passed). Not verified on macOS itself.
2026-10-31 01:37:54 -07:00
LGUG2Z 6cbeee20ae refactor(windows): print the Windows view of the schema of komorebi-config
komorebic static-config-schema prints schema::view::<StaticConfig>(Platform::CURRENT) of the shared crate instead of deriving the schema of the daemon's own StaticConfig: the text is the same, and the oracle test proves the Windows view equals schema.json (once komorebi-themes drops its cfgs, the next revision). The daemon's StaticConfigSchema socket answer (which answers the SocketMessage schema on Windows today) is left alone.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings: clean (tier 2). Not verified: running komorebic.exe.
2026-10-31 01:37:54 -07:00
LGUG2Z 7c655cbc25 refactor(komorebic): the Windows komorebic uses the pan module of komorebic-core
komorebic/src/pan.rs (809 lines) is deleted; pan --stream runs komorebic_core::pan with a PanLink that is the client connection (the orphan impl the crate cannot have). Behaviour is the same code.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings clean; the 16 pan tests now run in komorebic-core (native, 27 passed with the crate's own 11). oracle unchanged by construction (no clap definition touched).
2026-10-31 01:37:54 -07:00
LGUG2Z 2200bec995 refactor(config): add the one StaticConfig and its schema views to komorebi-config
static_config.rs holds the union: StaticConfig with all 56 keys and no cfg on a field, BorderColours, ThemeOptions, Wallpaper, WorkspaceConfig, MonitorConfig, AppSpecificConfigurationPath, AnimationsConfig, TabsConfig and StackbarConfig, taken from the Windows text (the superset) plus the KDE/macOS keys (border_radius, titleless_applications, tabbed_applications, window_hiding_position). A key that not every platform reads carries x-komorebi-platforms (22 Windows-only, 5 Windows+KDE, 4 KDE+macOS); the five #[deprecated] attributes became schemars deprecated markers so no daemon gets a deprecation warning for a key it still reads. The schema defaults that read daemon run-time statics are constants in defaults.rs (Windows values).

changes.rs holds what a platform's schema says differently from the union as data: descriptions (spelling and platform sentences), the defaults that are platform facts (paddings 10/5/5, border width 8/10/10, offset -1/0/0, no transparency default on KDE) and the nine komorebi-themes stackbar fields KDE and macOS never had. It was generated from the difference between the union view and each tree's checked-in schema.json; every entry is a candidate for a converge revision. schema::view applies it after pruning.

The oracle test builds the KDE and macOS views of StaticConfig and compares them with schema.json byte for byte: both identical (KDE 127164 bytes, macOS 120057 bytes). Windows is added when komorebi-themes drops its target_os cfgs (a Linux build omits those nine fields). No tree uses the new types yet.

Verified: native cargo test -p komorebi-config: 4 unit + 8 schemas passed, 0 failed (tier 1).
2026-10-31 01:37:54 -07:00
LGUG2Z 6d35c0c365 refactor(komorebic-core): add pan, the reader of the gesture stream, from the Windows komorebic
komorebic/src/pan.rs (parse_line, Forwarder, next_merged, the Sink and Link traits, Socket and run, with their 16 tests) is copied into the crate with its imports pointed at komorebi-layouts and komorebi-protocol. The one impl that needs the client, Link for komorebi_client::Connection, is left to each komorebic (an orphan); the tests read the transcripts of komorebic/fixtures, which the pan tests of both daemons use as well. The 16 tests could not run on Linux before and now do. Nothing uses the copy yet.

Verified: native cargo test -p komorebic-core --lib: 27 passed, 0 failed (11 + the 16 pan tests).
2026-10-31 01:37:54 -07:00
LGUG2Z 55c9efb0b2 refactor(kde): use the placement types of komorebi-config
core re-exports WindowPlacement, PlacementTarget, PlacementMatchingRules and InitialWindowPlacementRules from komorebi-config; the local definitions and impls (about 190 lines) are removed together with the imports they alone needed, so no call site changes.

Verified: KDE cargo check --workspace --all-targets: no warnings; cargo test -p komorebi --lib: 289 passed, 0 failed; --test schemas: 5 passed; komorebic regeneration: schema.json and schema.asc.json byte-identical to the checked-in files at this revision (no diff).
2026-10-31 01:37:54 -07:00
LGUG2Z 788265481e test(komorebic-core): every platform command line builds and keeps its subcommand count
Adds crates/komorebic-core/tests/platforms.rs (49 lines). It builds the clap command for the Windows, KDE and macOS option sets and asserts each keeps its subcommand count, so a variant dropped from the shared Messages enum fails loudly. Verified: cargo test -p komorebic-core passes natively on Linux.
2026-10-31 01:37:54 -07:00
LGUG2Z b0e4479723 refactor(config): move the placement types into komorebi-config
WindowPlacement, PlacementTarget (with its Display, FromStr, Ord, Serialize, Deserialize and hand-written JsonSchema impls), PlacementMatchingRules and InitialWindowPlacementRules, from the KDE copy: Windows and KDE have identical WindowPlacement, PlacementMatchingRules and InitialWindowPlacementRules, and PlacementTarget differs (Windows accepts the same values through a visitor and writes a different hand-made schema). The KDE copy is the union; Windows' schema text for PlacementTarget is carried as a per-platform difference of the view in the StaticConfig stage, so the Windows tree switches to these types in that stage, not before (switching earlier would change what its own derived schema prints).

The oracle checks the generated definitions of the three enums against Windows and KDE schema.json and PlacementTarget against KDE's.

Verified: native cargo test -p komorebi-config: 4 unit + 7 schemas passed, 0 failed (tier 1).
2026-10-31 01:37:54 -07:00
LGUG2Z 64457a97a3 refactor(komorebic-core): move the Windows subcommand definitions into the crate
WindowsCommands and the argument structs of the subcommands that are not in Messages (start, stop, check, kill, the border, stackbar and custom-layout commands, the app-specific-configuration converters and the ones whose help still differs between the trees) move from komorebic/src/main.rs to komorebic-core::platform::windows with their fields pub; the Windows main.rs keeps the handlers (2164 to 1520 lines). Three fields named after a protocol type that a struct of the same name shadows (BorderStyle, BorderImplementation, StackbarMode) are written with their full path. docgen-all now writes the Windows pages too, so no harness is needed any more.

Verified: oracle (step4/oracle-check.sh, Windows pages from the docgen-all example): windows 187 of 187 pages byte-identical, macos 158 of 158, kde 166 of 166; Windows cargo clippy --workspace --locked --all-targets -D warnings clean.
2026-10-31 01:37:54 -07:00
LGUG2Z 04139cce01 refactor(mac): use asc of komorebi-config
core::asc re-exports ApplicationSpecificConfiguration, AscApplicationRules and AscApplicationRulesOrSchema from komorebi-config; the local copy (60 lines) is removed. AscApplicationRules is now the union with the five Windows-only rule kinds, which macOS never sets.

As for KDE, the applications schema is printed and answered as the macOS view of the union (komorebic application-specific-configuration-schema, with the komorebi-config dependency, and the daemon's socket answer), so the printed text stays what schema.asc.json holds; the oracle test compares that view with the checked-in file byte for byte.

Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin --workspace --all-targets: finished, 0 errors (tier 2). Not verified: macOS unit tests, running komorebic.
2026-10-31 01:37:54 -07:00
LGUG2Z 001b7c98cd refactor(komorebic-core): move the macOS subcommand definitions into the crate
MacosCommands and the argument structs of the subcommands that are not in Messages (start, stop, quickstart, permissions, pan, the animation commands and the 18 whose help still differs between the trees) move from komorebi-for-mac/komorebic/src/main.rs to komorebic-core::platform::macos with their fields made pub; the macOS main.rs keeps the handlers (1293 to about 600 lines). The definitions have no macOS-only dependency, so the pages of the macOS command line can now be written on any host: the docgen-all example of the crate does it, and replaces the harness that compiled the clap section of main.rs. clap_complete joins the crate for Completions.

Verified: oracle (step4/oracle-check.sh, macOS pages now from the docgen-all example): macos 158 of 158 pages byte-identical (windows 187 and kde 166 still pass); macOS fake-CC cargo check --locked --workspace --all-targets: 0 errors; KDE cargo check -p komorebic: ok.
2026-10-31 01:37:54 -07:00
LGUG2Z 415e73a9ac refactor(kde): use asc of komorebi-config
core::asc re-exports ApplicationSpecificConfiguration, AscApplicationRules and AscApplicationRulesOrSchema from komorebi-config; the local copy (60 lines) is removed. AscApplicationRules is now the union with the five Windows-only rule kinds: KDE only reads and writes its own, the others are None and skipped when written.

A derived schema of the union would carry the Windows-only kinds and the x-komorebi-platforms markers, so the places that print or answer the applications schema ask for the KDE view instead: komorebic (application-specific-configuration-schema; komorebic gains the komorebi-config dependency, a two-line change in the arm) and the daemon's socket answer (same view, array form as before). This is the minimum change to komorebic that keeps its output; step 4 owns the rest of the file.

Verified: KDE cargo check --workspace --all-targets: no warnings; cargo test -p komorebi --lib: 289 passed, 0 failed; --test schemas: 5 passed; komorebic regeneration: schema.asc.json byte-identical to the checked-in file (git: no diff against wip-main), schema.json only differs by the earlier description-only converge revisions.
2026-10-31 01:37:54 -07:00
LGUG2Z 097f9f4244 refactor(komorebic): the Windows komorebic takes Messages and Opts<WindowsCommands> from komorebic-core
Same change as for KDE and macOS in the Windows komorebic: the 121 common subcommands come from Messages, the Windows ones stay in WindowsCommands, the command line is Opts<WindowsCommands>, send_or_query writes or prints any message and docgen goes through komorebic_core::docgen with DocFormat::PLAIN. main.rs goes from 3532 to 2164 lines. komorebic --help lists the Messages first.

Verified: oracle (step4/oracle-check.sh): windows 187 of 187 pages byte-identical (after the usual normalisation of the one cfg(target_os) line); Windows cargo clippy --workspace --locked --all-targets -D warnings clean. Not verified: the 16 pan tests of the Windows komorebic (they cannot run on Linux).
2026-10-31 01:37:54 -07:00
LGUG2Z 2bd0269df6 refactor(windows): use asc and the application configuration data of komorebi-config
core::asc re-exports ApplicationSpecificConfiguration, AscApplicationRules and AscApplicationRulesOrSchema, and config_generation re-exports ApplicationOptions and ApplicationConfiguration, from komorebi-config. The From<Vec<ApplicationConfiguration>> conversion that komorebic uses moved with them (orphan rule). The YAML generator stays. 215 lines removed.

AscApplicationRules is now the union, so komorebic's application-specific-configuration-schema prints the Windows view of it (komorebic gains the komorebi-config dependency; a three-line change in the arm, the minimum that keeps its output equal to schema.asc.json; step 4 owns the rest of the file). The daemon's own socket answer for this message is a different schema (Vec<ApplicationConfiguration>) and is untouched.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings: clean (tier 2). Not verified: running komorebic.exe; the oracle test proves the Windows view equals schema.asc.json byte for byte.
2026-10-31 01:37:54 -07:00
LGUG2Z c46320ea5b refactor(komorebic): the macOS komorebic takes Messages and Opts<MacosCommands> from komorebic-core
Same change as for KDE: the 121 common subcommands come from komorebic_core::messages::Messages, the macOS ones stay in MacosCommands (SubCommand renamed), the command line is Opts<MacosCommands>, send_or_query writes or prints any message, and docgen goes through komorebic_core::docgen with DocFormat::PLAIN. main.rs goes from 2661 to 1293 lines. komorebic --help lists the Messages first (see the KDE revision).

Verified: oracle (step4/oracle-check.sh, harness = the tree's clap section plus core's Opts<P>): macos 158 of 158 pages byte-identical (windows 187 and kde 166 still pass); macOS fake-CC cargo check --locked --workspace --all-targets: 0 errors, no warning in komorebic.
2026-10-31 01:37:54 -07:00
LGUG2Z 89c729e731 refactor(config): move asc and the application configuration data into komorebi-config
ApplicationSpecificConfiguration, AscApplicationRulesOrSchema and AscApplicationRules are code-identical in the trees except that AscApplicationRules differs in its rule kinds: five Windows-only kinds, titleless and tabbed on KDE and macOS. The crate holds the union (declaration order floating-first as before; the platform-only fields carry x-komorebi-platforms, so a view prunes them) and, for the Windows From<Vec<ApplicationConfiguration>> conversion that the orphan rule keeps next to its types, ApplicationOptions and ApplicationConfiguration (data only: the YAML generator stays in the Windows daemon). The crate gains the color-eyre dependency.

The oracle test builds the view of ApplicationSpecificConfiguration for Windows, KDE and macOS and compares it with each tree's checked-in schema.asc.json byte for byte: all three are identical. This is the first proof that per-platform views of one union reproduce the checked-in files exactly (D17/D18); the three trees still use their own copies.

Verified: native cargo test -p komorebi-config: 4 unit + 6 schemas passed, 0 failed (tier 1).
2026-10-31 01:37:54 -07:00