Commit Graph
12 Commits
Author SHA1 Message Date
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 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 8a17e0ad00 feat(wm): add socket subscriptions
This commit adds in the ability for users to subscribe to notifications
via a Unix domain socket. Code was mostly just migrated from komorebi.
Tested with "nc -vklU $(komorebic datadir)/test.sock" to create the
socket and listen and then "komorebic subscribe-socket test.sock" to
subscribe for notifications.
2025-09-24 16:30:44 -07:00
LGUG2Z 84d27f83e0 fix(wm): make hidden windows take up less space 2025-09-22 14:26:21 -07:00
LGUG2Z f6997577f1 fix(wm): respect workspace window rules
This commit adds window ID tracking like we do in komorebi for Windows
and fixes a bunch of bugs that were happening when a window on another
workspace was focused either via the Dock or cmd+tab, and also a bug in
workspace rules where on launch, a window would not respect workspace
rules due to another workaround that had been added to make Apple apps
work nicely.
2025-09-22 13:31:45 -07:00
LGUG2Z c84db9a894 feat(wm): impl state, global-state and visible-windows
This commit implements the State, GlobalState and VisibleWindows
SocketMessage variants. These are the first of the SocketMessage
variants send by komorebic which receive a reply which is printed out to
the console.

I think the next thing to do will probably be to get the extended
display info so that the MonitorInformation variant can be handled too.
2025-09-21 21:07:52 -07:00
LGUG2Z a4bc40aa5e feat(wm): add notification center listener
This commit adds a listener for the NotificationCenter of the
SharedWorkspace, which allows us to be notified of acts like new app
creation, app termination (different from app window destruction),
application hides and application unhides, among many others.

There are a lot of the AppKit notifications which can be registered with
observers on the notification center; for now I have just modeled the
AppKitWorkspaceNotification enum which seems to hold the most
interesting notifications for our use case.

NSWorkspaceDidLaunchApplicationNotification and
NSWorkspaceDidTerminateApplicationNotification are now hooked in to the
Show and Destroy WindowManagerEvents, but I still need to think about
how to hook in the events around hiding and unhiding as these are
temporary/reversible actions which operate across multiple application
windows, unlike minimize/restore which only operate on one application
window at a time.
2025-09-21 09:22:54 -07:00
LGUG2Z b7ce8c03b5 refactor(rust): standardize on ok_or_eyre and bail!
This commit standardizes the codebase to disallow usage of the raw eyre!
macro for creating errors, instead using ok_or_eyre() when constructing
ad-hoc errors from Result and Option types, and otherwise using the
bail! macro in response to failed boolean conditions.
2025-09-20 10:24:42 -07:00
LGUG2Z 71adb1c0e0 feat(wm): implement basic workspace layers
This commit implements some of the basic plumbing needed to handle
SocketMessage::ToggleWorkspaceLayer and SocketMessage::ToggleFloat.

I've commented out a bunch of the raise/lower functions for now because
I haven't had time to learn about how changing z-ordering on macOS works
yet.

Even so, this is fairly functional, and it's possible to move floating
windows across workspaces, toggle the workspace layer, move floating
windows by the resize delta, and change focus between floating windows.

I ended up moving the window restore positions to a global map because
storing/updating this kind of state on the Window properly will be a
pain because hide/restore now require mut self refs and that leads to
needing to clone sometimes.
2025-09-19 08:51:30 -07:00
LGUG2Z 4f6267b56e feat(wm): add basic window manager event handling
This commit adds a WindowManagerEvent enum and a channel to send and
receive variants of it on.

The skeleton of process_event has been migrated from komorebi and a few
basic implementations of handlers for core events like FocusChange,
Show, Destroy, Minimize and Restore have been added.

Due to the way the window observers work, in komorebi for Mac we'll need
to keep track of minimized Windows so that we don't drop their observers
(otherwise we won't receive a notification when they are restored).

Most of the code added in this commit around modifying state in response
to these events has been migrated from komorebi.
2025-09-18 11:12:27 -07:00
LGUG2Z b6d19e6a12 feat(wm): migrate workspace and layout code
This commit migrates big chunks of code from komorebi for Windows which
deal with state related to the Workspace struct, Layouts and the
Arrangement trait.

Layout remains an enum, but only the Layout::Default variant with
DefaultLayout has been migrated because there are no plans to support
EOL features in komorebi for Mac (custom layouts).

The code for updating the layout in main.rs has been moved to
Workspace.update, which is now called from main.rs instead.

As part of this initial migration of code, this project has been
restructured a little to match the layout of komorebi for Windows to
minimize my own confusion.
2025-09-17 13:31:39 -07:00
LGUG2Z 2b99a68ed8 feat(wm): initial commit 2025-09-16 16:53:11 -07:00