Commit Graph
26 Commits
Author SHA1 Message Date
LGUG2Z 6869805b82 feat(cli): add completions cmd
Add a new "completions" command which takes a supported shell as an
argument. This command outputs a completions file to stdout, which can
be redirected to a file.
2025-10-11 13:16:22 -07:00
LGUG2Z 7b65a24ea4 test(wm): migrate process command test cases 2025-10-11 10:52:53 -07:00
LGUG2Z 245770d45a chore(deps): cargo update 2025-10-06 16:37:14 -07:00
LGUG2Z 82b6247371 fix(bar): don't show komorebi-bar icon in the dock 2025-10-01 14:16:36 -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 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 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 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 795ffdfa33 docs(schema): add schemars feature + schemagen cmds
Starting to think about documentation and adding in commands to generate
JSON schemas for the ApplicationSpecificConfiguration, SocketSchema and
StaticConfig.

schemars 0.8 > 0.9 has way too many breaking changes for me to care
about right now, let around 0.8 > 1.0. I'm happy being pinned on 0.8 for
now.
2025-09-24 15:18:06 -07:00
LGUG2Z 627d150241 feat(wm): impl state queries
This commit implements SocketMessage::Query and responds correctly to
all of the various StateQuery options when komorebic query is called.
2025-09-22 21:40:24 -07:00
LGUG2Z b020b5bb69 feat(cli): add start and stop commands 2025-09-22 16:37:30 -07:00
LGUG2Z d77ae2d03a feat(cli): add log cmd
This commit adds logs written to files in the app's datadir, which can
then be tailed by the komorebic log command. temp_dir() was being weird
so I just stuck with DATA_DIR.
2025-09-22 15:55:19 -07:00
LGUG2Z 474f7e26d8 feat(wm): ensure we don't run multiple komorebi procs 2025-09-22 15:42:19 -07:00
LGUG2Z 465fa02afc feat(cli): add fetch-asc cmd
Now that we have an applications.mac.json file in the asc repo, this commit adds a fetcher command.
2025-09-22 14:46:28 -07:00
LGUG2Z 02523d8b34 feat(wm): enrich monitors with serial id
This commit does some wrangling of the ioreg output to enrich monitors
with product names and serial number IDs, the latter of which is very
important to maintain compatibility with komorebi for Windows.

I can't get the equivalent of device and device_id on macOS, but these
are legacy things in komorebi for Windows so I think I'll leave them
out.

To verify monitor information, SocketMessage::MonitorInformation has
been implemented.
2025-09-22 12:16:32 -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 d9a8634559 feat(config): migrate most of static config
This commit migrates everything needed to get to the point where I can
load my existing Windows komorebi.json file and have the key parts
working as expected (workspace rules, manage rules, ignore rules,
floating applications etc.)

A lot of lift and shift, some wrangling things to work with the subtle
changes in this codebase, but overall I'm very happy with this.
2025-09-21 19:33:48 -07:00
LGUG2Z 34beecdb22 feat(wm): migrate asc and config generation primitives 2025-09-21 17:28:33 -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 92701d902d feat(wm): add basic stacking support
This commit adds support for the StackWindow, UnstackWindow and
CycleStack SocketCommands. The code is largely just migrated from
komorebi.

It looks like there isn't a public API which can be used to hide
individual windows, either via AXUIElement or something constructed
using the window id.

For now I'm just moving the stacked window off the screen and this works
well enough. I also added some cleanup which ensures that when the
process exits, windows which are off-screen will be restored to their
last known position.
2025-09-18 15:43:49 -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 df9ceee17e feat(wm): migrate ipc and impl basic socket messages
This commit migrates another bunch of code from komorebi to start
implementing inter-process communication using Unix domain sockets.

For this commit a small subsection of the SocketMessage with maximum
utility has been migrated: FocusWindow, MoveWindow, ChangeLayout, and
TogglePause.

This includes migrating their handlers in process_command, and setting
up a UnixListener when creating a WindowManager instance.

To be able to test this functionality I also implemented a basic
skeleton of komorebic and migrated the komorebi-client library.

There are some random fixes included here now that we are listening to a
UnixListener on a separate thread, which includes wrapping structs from
the objc2 crate which don't have Send and Sync implemented, so that they
can be implemented in the komorebi lib.

I also took the time to figure out how to calculate a monitor's work
area size, excluding the dock and the menu bar, and started to split out
Workspace and Monitor into their own modules.

It looks like a lot of changes but most if this is just pulling in stuff
from the Windows implementation.
2025-09-17 16:18:06 -07:00
LGUG2Z 326c419666 feat(wm): add initial skeleton of wm state and initialization 2025-09-17 09:07:45 -07:00
LGUG2Z 2b99a68ed8 feat(wm): initial commit 2025-09-16 16:53:11 -07:00