Commit Graph
34 Commits
Author SHA1 Message Date
LGUG2Z 00faad73bf feat(scrolling): toggle a column between several slots and one stack
toggle-column-stack stacks the windows of the focused column in one
window slot, or spreads the focused stack out into a column with a
window in each slot, whichever the focused column is. A stack is what
a tabbed column already is, so this is the same thing seen from the
other side: existing stacks stay stacks, consume and expel make split
columns, and this switches either kind.

Stacking keeps the order of the windows and the one that had focus is
the one that shows. Spreading out puts the tabs in the order of the
tabs, with focus on the window that had it, and puts every window that
was out of sight where it is shown, the one that stays in its slot as
much as the ones that go to slots of their own. Focus stays on the
column while that is done, so that stacking and spreading out again
leaves the strip where it was. The column keeps its width. Heights that
its slots were given are not remembered for toggling back, which needs
more memory than a column keeps.

The stack is the stack of every layout, so cycle-stack, focus-stack-
window and stack work on it, and unstack takes the window that has
focus off into a column of its own to the right, which a test checks.

Like consume and expel it only does anything in the Scrolling layout.
The parking and restoring of windows is the code that stacks already
use, and was not seen on a screen. A test has no screen, so what would
be restored is recorded, and two tests check that every window of a
spread out stack is and that the strip stays put.
2026-10-29 16:38:53 -07:00
LGUG2Z 2363ff6c3a feat(workspace): keep the width of a window that moves to another workspace
A container goes from one workspace to another by being taken out of
one and put into the other, with nothing between them that both could
be asked, so a window that was moved started again with the default
width, as did one moved to another monitor.

Taking a container out of a workspace now says what its column was
given, which komorebi_layouts::scrolling keeps, and the strip of the
workspace that has the container next finds it there the first time it
sees it, before it is made to match the list. So the window is a column
of its own as wide as the column it left, whichever way it got there,
and a window that moves on takes what it has where it is. Nothing is
remembered for a container that no strip had been asked about.
2026-10-29 16:38:53 -07:00
LGUG2Z e23dc085f9 feat(scrolling): resize the heights of windows in a column
The heights that the model can give the tiles of a column are now
reachable. Resizing a vertical edge makes the focused window taller or
shorter by half of the resize delta, as a horizontal edge does for a
column, and the others in its column share what it leaves. No window is
made shorter than 100 pixels, and retile puts heights back as well as
widths.

A window that is alone in its column fills it, so all of this does
nothing for it, and the other layouts are not affected.
2026-10-29 16:38:53 -07:00
LGUG2Z 5d78b22a8b feat(scrolling): put several windows in a column of the scrolling layout
The strip's tiles are the workspace's containers, in the order of the
list, so a column is a run of the list and every container still gets
one rectangle: the layout pass, latest_layout, drag and the borders are
as they were. Everything that changes the order of the containers does
it on the list, and the strip is made to match on the next pass.

- consume left|right and expel make and unmake columns of several
  windows, and only do anything in the Scrolling layout for now
- focus left and right go to the neighbouring column and to the window
  in it that had focus last, and up and down go between the windows of
  the column and carry on to another monitor at the ends, as before
- move left and right move the whole column, and up and down swap the
  window with the one above or below it, past which the list changes
- a new window goes after the last window of the focused column and
  not after the focused window, so that it is a column of its own and
  does not split the one it was opened next to
- the strip is no longer thrown away when the layout is not Scrolling,
  so that widths come back when it is again

Heights are equal and there is no command to change them yet. A window
that is moved to another workspace or monitor starts again with the
default width.
2026-10-29 16:38:53 -07:00
LGUG2Z ebc9d49d77 feat(scrolling): make room for windows that will not get as narrow
Many apps will not make a window narrower than some width. The layout
placed the next column as if the window had the width it was given, and
so placed it on top of the window that had not.

What the arrival module has been told, the layout picks up at the start
of the next pass: a column is never narrower than the window in it
needs, plus the padding and border around it and capped at the width of
the screen, and the columns after it are placed where it ends. A limit
only ever goes up, so that a column does not bounce between two widths,
and a stack takes the widest of its windows.

With animations off the layout asks every window that it resized what
it is, with a timeout, and places everything once more if one refused.
With animations on the animator says so when a journey ends, so a
window that refuses is noticed then as well.
2026-10-29 16:38:53 -07:00
LGUG2Z b496bd8858 feat(scrolling): add full-width, expand and center-focus commands
The model could take the full width, fill the room that the columns in
view leave, and centre a column, but nothing called it. These commands
do, the first in the scrolling-layout family that
scrolling-layout-columns started, and the others named plainly,
center-focus to match promote-focus:

- scrolling-layout-full-width
- expand
- center-focus

Each is about the container that has focus now, even if focus moved
since the last layout, and does nothing until there is a strip, or in
another layout. A column made the full width of the screen takes the
gaps into account, so that it fills the screen exactly. expand makes the
focused column as wide as it can be without moving another column out of
view, which is the full width of the screen when it is the only one in
view or when the focused column is always centred, and does nothing when
there is no room.

Nothing changes in the shared layouts crate, so Windows is not affected.
2026-10-29 16:38:53 -07:00
LGUG2Z 2fb9dfdffa feat(workspace): make retile put the widths of scrolling columns back
retile already forgot the resize adjustments of the layouts that are
made of splits, and the widths of the columns of the Scrolling layout
are the same kind of thing. The focused workspace of each monitor
gets its columns back to what scrolling-layout-columns gives, and the
focused column stays where it is unless it has to scroll.

The variant of retile that keeps resize dimensions keeps the widths.
2026-10-29 16:38:53 -07:00
LGUG2Z acc4d7d67a docs(repo): describe the scrolling layout
Add a page on the Scrolling layout: how column widths work, when the
screen scrolls, what closing a window focuses, how resizing works, where
windows that are out of view go and why, and what is not done yet.
2026-10-29 16:38:24 -07:00
LGUG2Z d9319e0f66 docs(komorebic): say what scrolling-layout-columns means
The Scrolling layout no longer shares the screen between however many
windows there are until `columns` of them exist. The count is how many
columns fit across the screen, which is how wide a new column is, so the
help says that, and not that it is the number of visible columns.
2026-10-29 16:38:24 -07:00
LGUG2Z 86adb69bd3 docs(animation): describe how to use animations
Describe the duration, style and fps options, per-animation settings, and what
to expect from the animator: windows stay in step with each other, apps that are
slow to resize are sent sizes less often, and a window that is grabbed is let
go of.
2026-10-29 16:38:24 -07:00
LGUG2Z 2cd5884f21 docs(schema): regenerate schemas, nix options and cli docs
Bring the generated files back in line with the code on master.

- schema.json: add monocle_focus_behaviour and the MonocleFocusBehaviour
  definition. schema.asc.json and schema.bar.json were already current.
- nix/komorebi-options.nix: add the monocle_focus_behaviour option.
  nix/komorebi-bar-options.nix was already current.
- docs/cli: add the pages for layout-ratios, monocle-focus-behaviour,
  permissions and toggle-monocle-focus-behaviour. Update 19 pages for
  the --bar flag of enable-autostart, the per-value help of enum
  arguments and reworded help text. Re-wrap 4 pages whose text did not
  change.

How the files were made:

- schemars-nixgen writes the properties of an object in a different
  order on every run, so the files are not regenerated whole. Only the
  new option is added; the rest of a full run was checked to be the same
  lines in another order.
- docgen on master writes a bare fence with no heading and "Usage: name",
  where the pages in docs/cli have a "# name" heading and "Usage:
  komorebic name". The pages keep the format they have.
- Pages are wrapped at 100 columns, the width docgen uses when it does
  not write to a terminal, instead of the width of the terminal the old
  pages were made in.
2026-10-29 16:38:24 -07:00
LGUG2Z 3ef2377040 docs(quickstart): enable fewer widgets in the bar's example config 2026-02-06 17:08:51 -08:00
LGUG2Z c23bf462cb feat(bar): make explicit monitor config optional
This commit makes the monitor configuration option for the komorebi-bar
optional, defaulting to index 0. Additionally, the automatic work area
adjustment has been re-enabled for displays where are not built-in
Macbook displays.
2026-01-04 14:29:21 -08:00
LGUG2Z ca94a57dd5 feat(bar): render at notch level on macbooks
This commit uses raw-window-handle to access the NSWindow of the bar and
set the window level to `kCGBackstopMenuLevel` (-20), positioning the
bar behind the menu bar, and at the same level as the notch on Macbook
screens.

This approach means the bar occupies space already excluded from the
work area by the menu bar, so the automatic work area offset calculation
is no longer needed and has been commented out. (I think... Need to
validate this on regular non-Macbook external displays...)

The explicit user-configured `work_area_offset` option is preserved for
users who want more flexibility.
2026-01-03 10:13:17 -08:00
LGUG2Z 9b6b86cdea fix(wm): send manual move/resize end events on mouse release
The Acessibility API does not reliably fire AXWindowMoved and
AXWindowResized notifications after the mouse button is released,
causing drag-to-swap and drag-to-resize operations to fail.

This sends manual MoveEnd and ResizeEnd events from the input
event listener when LeftMouseUp is detected, ensuring these
operations complete reliably.

Resizing windows while dragging doesn't really work and has been noted
in the known-issues.md file.
2025-12-31 18:41:44 -08:00
LGUG2Z 23aca28267 build(nix): add generated module opts and validation
This commit adds NixOS module option generation for komorebi and
komorebi-bar configurations, along with a nix and JSONSchema validation
test harness that runs as part of `nix flake check`.

`schemars-nixgen` (same as `schemars-docgen`, not sure if I'm gonna
release this...) generates strongly-typed Nix option definitions from
the generated JSONSchema files, allowing users to write type-checked Nix
configurations that map directly to the config files.

This will eventually be plugged into a nix-darwin module which I have
yet to start writing.
2025-12-24 17:18:41 -08:00
LGUG2Z a56f2b42d4 docs(schema): remove custom layout and stackbar refs
This commit removes references to custom layouts and the stackbar as
these are end-of-life komorebi for Windows features which are not being
ported.
2025-12-23 20:07:46 -08:00
LGUG2Z f42457e2e8 feat(animation): add window movement animations
This commit adds window movement animations to komorebi for macOS,
maintaining configuration API compatibility with komorebi for Windows.

The animation system is adapted from the Windows implementation but uses
macOS-specific APIs for screen update batching and accessibility
control, and borrows heavily from the implementation details of
animations in rift.

In order to have decent performance, there are some calls to private
APIS. For this reason, the animation feature will be marked as "UNSAFE".

UNSAFE features should be expected to break between major operating
system updates, and depending on which way I want to go, may only
support one major macOS version at a time (i.e. they will not have a
backwards compatibility guarantee with previous versions of macOS).

This currently look awful when used with the Scrolling layout, but looks
relatively good with other layouts. As with Windows, the animations
when two windows of very different sizes change position aren't great.

Some high level notes on the implementation:

* Uses the private SkyLight framework for screen update batching via
  SLSDisableUpdate/SLSReenableUpdate - these APIs prevent visual flicker
  by compositing all window position changes at once rather than updating
  each window individually during layout operations
* AnimationEngine runs animations in background threads with frame-based
  timing, supporting cancellation when new animations are triggered for
  the same window
* MovementRenderDispatcher implements the RenderDispatcher trait to
  interpolate window positions using configurable easing functions
* All 30+ easing styles from the Windows implementation are supported,
  including standard CSS-style functions and CubicBezier for custom curves
* Enhanced User Interface (AXEnhancedUserInterface) is temporarily
  disabled during window positioning operations for better performance
* The Transparency animation prefix is not supported on macOS as there
  is no equivalent to the Win32 transparency feature

This feature is off-by-default and can be enabled in the static config
or via komorebic commands (animation, animation-duration, animation-fps,
animation-style).
2025-12-23 19:04:33 -08:00
LGUG2Z b09e979af5 feat(wm): promote containers by swapping indices
This commit adds a new SocketMessage variant PromoteSwap and
corresponding komorebic promote-swap command.

PromoteSwap will also promote the focused window container to the
largest tile in the layout, but instead of removing the focused
container x from the Ring and inserting it into position 0, possibly
changing the positions of other windows between 0 and x, the indices x
and 0 in the Ring will be swapped directly.
2025-11-04 07:53:29 -08:00
LGUG2Z 34db2e2c90 feat(wm): add visual feedback for preselections
This commit adds visual feedback in the form of a ghost tile for
preselections made by the preselect-direction command.

A container with the id "PRESELECT" will be added to the workspace, and
replaced when the next manage-able window is spawned.

A new command, cancel-preselect has been added to remove both the
preselection index and the ghost tile if the user changes their mind.
2025-11-02 11:03:11 -08:00
LGUG2Z 3128968634 feat(wm): add direction preselection
This commit adds a new feature to preselect the direction of the next
spawned window with a corresponding komorebic preselect-direction
command which takes an OperationDirection.

If the OperationDirection is valid from the current position, it will be
stored in the Workspace state, and then read, applied, and deleted when
the next manage-able window is spawned.
2025-10-31 15:12:19 -07:00
LGUG2Z 9dbae50909 feat(wm): add a splash screen for mdm devices
A little nudge for people to do the right thing, 1990s vibes.
2025-10-28 18:25:05 -07:00
LGUG2Z 202238aecd docs(mkdocs): add homebrew installation instructions 2025-10-27 12:21:50 -07:00
LGUG2Z f729cc2b81 docs(mkdocs): add notes about system configuration suggestions 2025-10-10 14:25:14 -07:00
LGUG2Z a8a2f923cf style(mkdocs): add information about komorebi-bar 2025-10-06 15:41:12 -07:00
LGUG2Z 9777c55a1f feat(bar): migrate the komorebi-bar
This commit migrates the komorebi-bar from komorebi for Windows. Mostly
lifting and shifting code, exposing stuff we need in komorebi-client
etc.

A few widgets will need to be reworked completely so they have been
removed for now.

Mouse and command stuff also needs updating a little so that has also
been removed for now.
2025-09-30 15:14:30 -07:00
LGUG2Z 0cbf02b604 feat(config): implement border manager options
This commit enables the border, border_width, border_offset and
border_colours options in StaticConfig, and hooks them up to the
relevant variables in the border manager module.
2025-09-30 09:34:14 -07:00
LGUG2Z 7aea35dff1 docs(examples): ensure skhdrc samples don't conflict with mission
control
2025-09-27 15:40:45 -07:00
LGUG2Z cd5f660455 feat(cli): add permissions prompts to quickstart 2025-09-27 13:06:22 -07:00
LGUG2Z fb416e75fd feat(wm): implement move resizing and moving
This commit implements moving and resizing by mouse as it works in
komorebi for Windows. We're able to make this a bit nicer here because
macOS emits separate events for resizing and movement, so now we have
MoveStart/MoveEnd and ResizeStart/ResizeEnd.

Resizing is a little janky because the system does not update the
position of resized windows quickly enough, so if you do a quick drag
and release the left mouse button, sometimes the accessibility
attributes for the size and position of that window won't have been
updated, and no resize will take place.
2025-09-27 10:55:34 -07:00
LGUG2Z 6a194f7e6c docs(mkdocs): initial outline of documentation website 2025-09-26 16:47:20 -07:00
LGUG2Z d0121815ea feat(cli): add enable and disable autostart cmds 2025-09-26 15:47:59 -07:00
LGUG2Z 3792da1bb3 feat(cli): impl quickstart and update config dir
This commit implements the komorebic quickstart command, adds a sample
komorebi.json and a sample skhdrc file which get built into the
komorebic binary, and updates the default config path on macOS to
$HOME/.config/komorebi
2025-09-26 15:10:03 -07:00
LGUG2Z f9dd8cf9f1 docs(mkdocs): add generated markdown docs for cli cmds 2025-09-26 12:50:17 -07:00