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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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