Commit Graph
113 Commits
Author SHA1 Message Date
LGUG2Z d08e0b0cd9 test(wm): migrate workspace test cases 2025-10-11 10:46:07 -07:00
LGUG2Z c819907a4d test(wm): migrate container test cases 2025-10-11 10:46:04 -07:00
LGUG2Z f729cc2b81 docs(mkdocs): add notes about system configuration suggestions 2025-10-10 14:25:14 -07:00
LGUG2Z aa718bf6e9 fix(wm): delegate all cmd+tab focus changes to ws reconciliator
Mainly a cleanup PR - there were some subtle bugs introduced trying to
exclude the ManualNotification for cmd+tab focus changes, but since this
is all being delegated to the workspace reconciliator now, we can remove
those confusing matches! guards and that variant all together.
2025-10-10 09:56:09 -07:00
LGUG2Z 141eedfd60 fix(wm): preserve state on screen lock and unlock
Screen locking and unlocking is a bit weird in macOS because it's
implemented as a separate app which is activated and deactivated, so
unique events for screen lock and unlock are never emitted by the
system.

This commit encapsulates the logic to detect the relevant events on the
loginwindow into the creation of ScreenLock and ScreenUnlock
WindowManagerEvent variants.
2025-10-09 19:19:51 -07:00
LGUG2Z acee420bd3 feat(wm): implement ws reconciliator with source debouncing
Hello infinite workspace switching loop, my old friend.

Reimplemented the old workspace reconciliator from komorebi for Windows
with additional source debouncing and tested by furiously mashing alt-1
and alt+2 for 20s. No loop!
2025-10-09 16:54:14 -07:00
LGUG2Z 7bbad6539d fix(wm): ensure messages window close by click is handled
Stupid Apple stuff. Something was up with Messages leaving a ghost tile
when being closed by the red dot vs. cmd+w - this change fixes that, but
will probably break something else.
2025-10-07 18:41:46 -07:00
LGUG2Z ed2185a667 feat(config): add window hiding position behaviour
This commit adds a new monitor configuration option
"window_hiding_position", which takes an enum with the variants
BottomLeft and BottomRight.

Until now the behaviour had been hard-coded to hide windows at the
bottom left of every monitor.

If no value is given on a monitor configuration object, this option will
default to BottomLeft.
2025-10-07 16:46:40 -07:00
LGUG2Z 05e4222a23 refactor(rust): remove lots of unsafe blocks 2025-10-06 16:50:10 -07:00
LGUG2Z 0789ed0136 chore(deps): flake.lock: Update
Flake lock file updates:

• Updated input 'crane':
    'github:ipetkov/crane/a669fe77a8b0cd6f11419d89ea45a16691ca5121' (2025-09-18)
  → 'github:ipetkov/crane/1e7905b1eb1b551aade75169940557b6c51ed920' (2025-10-05)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/8eaee110344796db060382e15d3af0a9fc396e0e' (2025-09-19)
  → 'github:nixos/nixpkgs/7df7ff7d8e00218376575f0acdcc5d66741351ee' (2025-10-02)
• Updated input 'rust-overlay':
    'github:oxalica/rust-overlay/d2bac276ac7e669a1f09c48614538a37e3eb6d0f' (2025-09-22)
  → 'github:oxalica/rust-overlay/edea9f33f9a03f615ad3609a40fbcefe0ec835ca' (2025-10-06)
2025-10-06 16:40:19 -07:00
LGUG2Z 245770d45a chore(deps): cargo update 2025-10-06 16:37:14 -07:00
LGUG2Z 163ba7051d docs(readme): update with relevant information 2025-10-06 15:58:59 -07:00
LGUG2Z a8a2f923cf style(mkdocs): add information about komorebi-bar 2025-10-06 15:41:12 -07:00
LGUG2Z b02711e86d fix(wm): improve video fullscreen handling
This commit improves browser video fullscreen handling with borders. We
are now emitting an event for
AppKitWorkspaceNotification::NSWorkspaceActiveSpaceDidChangeNotification,
even though it doesn't have a pid, by passing a dummy 0 pid.

This is really stupid and I shouldn't do this.

This lets us act with more granularity in process_event to destroy or
redraw borders when entering or exiting browser video fullscreen.

In addition, the reaper has been updated to not reap fullscreen windows
so that they can be reintegrated into the layout without issue when
fullscreen is exited.
2025-10-06 15:00:40 -07:00
LGUG2Z 82b6247371 fix(bar): don't show komorebi-bar icon in the dock 2025-10-01 14:16:36 -07:00
LGUG2Z f5a979d4b4 fix(bar): calculate margin correctly 2025-10-01 13:55:42 -07:00
LGUG2Z 75373c2174 fix(bar): load app icons for focused window widget
This commit adds the icon path to WindowDetails and then uses that path
to look up and load the icon in komorebi-bar.
2025-10-01 11:19:43 -07:00
LGUG2Z c9eeaf3999 chore(deps): bump egui and eframe to 0.32 2025-09-30 18:50:22 -07:00
LGUG2Z c3a756cbde fix(bar): don't look up window titles at runtime
Doing runtime lookups via methods on Window in komorebi-bar won't work
because the AccessibilityObserver is not serialized and sent as part of
the notifications.

Instead, the notifications now take a snapshot of WindowDetails and
embed them so they can be read directly in komorebi-bar.
2025-09-30 15:54:15 -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 230acf3547 fix(client): wrap axobservers in an option to avoid deser crashes
This commit fixes a crash for subscribers who try to deserialize state
from notifications. Even though skip_deserializing is used on the
AccessibilityObserver, we still need a sane Default, so we wrap the
inner AXObserver in an Option and default to None.
2025-09-30 13:03:40 -07:00
LGUG2Z ded36d39ee docs(schema): update jsonschema files 2025-09-30 11:07:00 -07:00
LGUG2Z 801be91508 feat(wm): implement monitor/ws wallpapers
This commit implements per-monitor and per-workspace wallpapers and
integrates with the theme manager to optionally generate themes based on
the palette of the wallpaper image.

Mostly a lift-and-shift from komorebi for Windows.
2025-09-30 11:02:38 -07:00
LGUG2Z f4d9734655 feat(wm): implement theme manager
This commit implements the theme manager from komorebi for Windows.
Mostly a lift and shift. Might look into the wallpaper stuff next.
2025-09-30 09:59:26 -07:00
LGUG2Z 8950a32bbb feat(cli): implement border-related cmds
This commit implements the various border-related SocketMessage variants
and the komorebic commands to send them.
2025-09-30 09:42:04 -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 28e0a2b75d feat(wm): impl first pass of border manager
This commit introduces a very introductory attempt at a border manager.
All of the colors work, from some brief usage it seems to behave as
expected based on windows, with some caveats.

There are issues with the window layering and popups which are annoyng -
the borders always stay drawn on top of RustRover popups, for example.

Also, the window tracking is incredibly slow and laggy when you try to
move or resize using the mouse.

Probably because the implementation uses NSWindow under the hood which
according to Google is notoriously unperformant. None of the config
options have been brought over yet.

The border manager is defaulting to off for now in the absence of config
- anyone at this commit who really wants to try it out should set
BORDER_ENABLED in border_manager/mod.rs to "true".
2025-09-29 20:54:17 -07:00
LGUG2Z a398609071 refactor(wm): start using gcd dispatch
This commit switches from executing things which need a MainThreadMarker
in our main loop in main.rs to executing them via Grand Central Dispatch
using the dispatch2 crate.

All the monitor reconciliator stuff is now much faster.
2025-09-29 11:15:07 -07:00
LGUG2Z 9b9c96a89d fix(wm): don't duplicate windows on empty workspaces
This commit fixes a subtle boolean logic bug that I think was introduced
by a "cargo clippy --fix" to apply some new boolean chaining stuff in
Rust 2024.

Gotta be more careful.
2025-09-27 17:02:01 -07:00
LGUG2Z 7aea35dff1 docs(examples): ensure skhdrc samples don't conflict with mission
control
2025-09-27 15:40:45 -07:00
LGUG2Z e5468dc036 feat(wm): ignore events on other spaces
This commit ensures that events and commands on spaces other than the
one that komorebi was started on will be ignored.
2025-09-27 13:26:32 -07:00
LGUG2Z cd5f660455 feat(cli): add permissions prompts to quickstart 2025-09-27 13:06:22 -07:00
LGUG2Z 400cb63c6a fix(wm): ensure window restore positions get updated 2025-09-27 11:05:44 -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 69909df2f5 fix(wm): avoid display notification spam
Looks like macOS spams every single possible CGDisplayChangeSummaryFlag
whenever a display is added or removed, which ends up with a lot of
calls to the monitor reconciliator and a lot of locks on the wm state.

To better handle the spam this commit ensures we only send monitor
reconciliation notifications on the DesktopShapeChanged, Add and Remove
flags.
2025-09-27 09:22: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 33c319ef61 fix(wm): ensure floating layer behaviour is respected
This commit ensures that the floating layer behaviour configured by the
user at the top level of the config is propagated properly, and also
that it is respected during FocusChange events.
2025-09-26 14:33:51 -07:00
LGUG2Z f9dd8cf9f1 docs(mkdocs): add generated markdown docs for cli cmds 2025-09-26 12:50:17 -07:00
LGUG2Z 7bb0aaac48 feat(cli): add docgen cmd and jsonschema just target
This commit adds a docgen command to generate markdown documentation
files of all of the CLI commands, and a justfile target to generate
JSONSchema files.
2025-09-26 12:49:23 -07:00
LGUG2Z 486aecda4c fix(wm): respect rules on startup window scan 2025-09-26 12:43:31 -07:00
LGUG2Z ae0ce4c95d fix(wm): address more monitor reconciliation bugs
This commit fixes another deadlock and a forces the hiding of
non-focused workspaces on all monitors after a DisplayConnectionChange
event results in a different number of total monitors in the wm state.
2025-09-26 12:43:27 -07:00
LGUG2Z 4b0b2f4013 feat(wm): add cross-monitor focus and moves
Forgot that I had hardcoded the window based work area offset lol.
2025-09-26 10:08:34 -07:00
LGUG2Z fa6ce669f7 fix(wm): use absolute monitor sizes and fix deadlock
This commit switches to using absolute intead of relative monitor sizes,
I don't fully understand by the NS APIs and the CG APIs return totally
different coordinate systems.

There was also a deadlock in the monitor reconciliator which I think I
figured out; it's a little ugly both in code and in execution but the
deadlocks and pkill -9s can be put away from now.

Cross-monitor moves aren't working which I'll look into next.
2025-09-26 09:53:37 -07:00
LGUG2Z f7afe4f8ec fix(wm): change ws on cmd+tab across ws
This is gonna drive me insane. Previous fix for something broke this.
Now we only try to focus in FocusChange on a base case if the workspace
we are on contains the target window.

This lets us fall through to the end of the handler which will try to
switch workspace if we know it's on another workspace.

Also fixed another bug around focusing the correct window on the
workspace switched to (since all the apps fire AX events when the
workspace is switched) by introducing a new ManualNotification which
lets us target the specific window that was cmd+tabbed to.
2025-09-25 17:54:47 -07:00
LGUG2Z a6ced512d7 feat(wm): migrate monitor reconciliator
I have no idea if this works at this point, I just tried to get
everything compiling and adhering to the macOS threading model for
access to NSScreen.
2025-09-25 17:20:01 -07:00
LGUG2Z 7217f311f2 feat(wm): implement replace configuration
I think this is the last SocketMessage variant I'll be bringing over
before working on docs. Haven't tested this one but it should work
pretty much the same as on Windows.
2025-09-25 14:32:08 -07:00
LGUG2Z c66db5a0bd feat(cli): implement display index preference cmd
This commit implements the komorebic display-index-preference command
for updating display index preferences, however the monitor
reconciliator module has not been reimplemented completely yet so these
values will not have any effect.
2025-09-25 14:23:43 -07:00
LGUG2Z 61369df025 feat(wm): impl window debugging socket message
I think this was only used in komorebi-gui before. I should see how
difficult it'll be to migrate that for macOS as well.
2025-09-25 14:09:51 -07:00