Commit Graph
92 Commits
Author SHA1 Message Date
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
LGUG2Z 563c3b8446 feat(cli): implement save/load resize dimensions cmds 2025-09-25 13:53:35 -07:00
LGUG2Z 8f36549fae feat(cli): implement generate-static-config cmd 2025-09-25 12:41:10 -07:00
LGUG2Z c59e882a2d feat(cli): implement manage and unmanage cmds
In implementing these two I'm diverging from how komorebi for Windows
handles these a little by tracking the window IDs of manually unmanaged
applications in a global vec UNMANAGED_WINDOW_IDS.

This is due to other changes in how Show and Destroy are handled in
komorebi for macOS which means we can't just piggy-back on those
handlers like we used to.
2025-09-25 12:34:07 -07:00
LGUG2Z 20d6121568 feat(cli): implement close cmd 2025-09-25 10:29:29 -07:00
LGUG2Z a89b9cf5ac feat(cli): implement minimize cmd 2025-09-25 10:19:11 -07:00
LGUG2Z 8c4c1963bc refactor(wm): tidy up 3a24b51
Instead of doing an adhoc check just against PERMAIGNORE classes, we
might as well construct a temporary Window to check the result of the
full Window.should_manage call.
2025-09-25 10:18:38 -07:00
LGUG2Z e478ab8d0a feat(wm): implement stop handlers
This commit implements the Stop and StopIgnoreRestore SocketMessage
variants and sends them from the komorebic stop command. The ctrl-c
handler in main.rs now exits with code 130, while the Stop handlers will
exit cleanly with code 0.
2025-09-25 07:30:28 -07:00
LGUG2Z 3a24b51111 fix(wm): be more discerning with input event listener
This commit fixes a couple of subtle bugs. The InputEventListener will
now only emit a custom Show event if the CGEvent was a LeftMouseUp.

AXDialog subroles have been added to PERMAIGNORE_CLASSES, and an
additional check against PERMAIGNORE_CLASSES has been added in the Show
handler because apparently windows can change their roles after they are
created.

I had also missed a line to make sure we focus windows in a base case in
the FocusChange handler, which has now been added.
2025-09-24 21:23:26 -07:00
LGUG2Z e1be883dab feat(wm): add targeted container lock socket messages
This commit migrates the LockMonitorWorkspaceContainer and
UnlockMonitorWorkspaceContainer SocketMessage variants, which if I'm
remembering correctly were implemented to help with functionality on the
komorebi-bar.
2025-09-24 18:38:55 -07:00
LGUG2Z 20c3bbd9a1 docs(schema): add cmd to generate notification schema 2025-09-24 18:27:04 -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 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 8d9d60b2e1 feat(cli): migrate more cli cfg cmds
I think this is all of the config commands migrated to komorebic now.

I still need to look in to the ManageFocusedWindow and
UnmanageFocusedWindow SocketMessage variants, as well as everything to
do with monitor reconciliation, but next I think I'll focus on trying to
generate the schemas.
2025-09-24 14:49:25 -07:00
LGUG2Z b2d4dff929 feat(cli): migrate a bunch of cfg cmds
This commit migrates a whole bunch of interactive runtime configuration
komorebic commands and implements their corresponding SocketMessage
variants.

Largely lifted as-is from komorebi for Windows.
2025-09-24 08:39:54 -07:00
LGUG2Z 0b17721580 feat(cli): implement eager-focus cmd
This commit implements SocketMessage::EagerFocus and the corresponding
komorebic eager-focus command. Mostly a straight migration from
komorebi.
2025-09-23 21:29:03 -07:00
LGUG2Z 7178609daf feat(cli): implement a bunch of rule cmds
This commit implements a whole bunch of commands around runtime
manipulation of ignore rules, manage rules and workspace rules. Mostly
lifted straight from komorebi.
2025-09-23 19:35:18 -07:00
LGUG2Z 10aabdac2c fix(wm): prune duplicate windows on ws
Got into a weird state after turning on my monitor where the same
window_id appeared in two separate containers on the workspace, so this
commit ensures that we always prune duplicate windows before updating
the workspace layout.
2025-09-23 15:04:54 -07:00
LGUG2Z dddd79d39d refactor(wm): migrate entire socketmessage enum
To give me a better idea of how the question for SocketMessage handling
parity is going, I have copied over the entire SocketCommand enum from
the Windows repo and commented out anything not yet implemented.
2025-09-23 14:37:21 -07:00
LGUG2Z a31dcbc54c refactor(cli): migrate entire subcommand enum
To give me a better idea of how the quest for komorebic command parity
is going, I have copied over the entire SubCommand enum from the Windows
repo and commented out anything not yet implemented.
2025-09-23 14:31:44 -07:00
LGUG2Z d49de398b6 feat(wm): handle various ws overrides for new windows
This commit migrates a bunch of code from komorebi that deals with how
new windows should be handled according to the various floating and
container behaviour overrides.

To help test this functionality I also finished migrating the
SessionFloatRule, SessionFloatRules and ClearSessionFloatRules
SocketMessage variants.
2025-09-23 14:18:00 -07:00
LGUG2Z 0ede90ae5d feat(wm): handle show events for apps that don't emit them
This commit introduces a little hack to emit a WindowManagerEvent::Show
every time the input event listener callback is triggered.

This is needed because some apps like Ghostty and Safari do not trigger
any events when a tab is split out into an independent window.

To keep things a little cleaner, a new SystemNotification::Manual
variant has been added which takes a ManualNotification variant.

The idea is to be able to use one of these whenever we manually emit a
notification to the window manager event listener to hopefully save my
sanity when we have to debug something in the future.
2025-09-23 13:34:50 -07:00