Commit Graph
46 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 f5a979d4b4 fix(bar): calculate margin correctly 2025-10-01 13:55:42 -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 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 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 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 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 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 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 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 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 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 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 7467b8e30a feat(cli): add config and datadir commands 2025-09-22 15:45:04 -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 565c6cd6f8 feat(wm): implement remaining cycle and stack cmds
This commit implements the CycleFocusWindow, CycleMoveWindow, StackAll,
UnstackAll, FocusStackWindow and CycleStackIndex SocketMessage variants.

Largely a code migration from komorebi.
2025-09-19 11:55:38 -07:00
LGUG2Z 19686d9778 feat(wm): implement various focus and move cmds
This commit implements the MoveContainerToLastWorkspace,
SendContainerToLastWorkspace, MoveContainerToMonitorNumber,
CycleMoveContainerToMonitor, MoveContainerToWorkspaceNumber,
MoveContainerToNamedWorkspace, CycleMoveContainerToWorkspace,
SendContainerToMonitorNumber, CycleSendContainerToMonitor,
SendContainerToWorkspaceNumber, CycleSendContainerToWorkspace,
SendContainerToMonitorWorkspaceNumber,
MoveContainerToMonitorWorkspaceNumber, SendContainerToNamedWorkspace,
CycleMoveWorkspaceToMonitor, MoveWorkspaceToMonitorNumber, and
SwapWorkspacesToMonitorNumber SocketMessage variants.

This is primarily a lift-and-shift from komorebi.

I still have no idea if the monitor-related stuff works as expected.

I need to figure out how to construct a light Window from a window_id to
be able to call move_to_area() when moving a container to another
monitor.
2025-09-19 11:37:09 -07:00
LGUG2Z e883f4a161 feat(wm): implement various monitor & ws focus cmds
This commit implements the CycleFocusMonitor, CycleFocusWorkspace,
CycleFocusEmptyWorkspace, FocusMonitorNumber, FocusMonitorAtCursor,
FocusLastWorkspace, CloseWorkspace, FocusWorkspaceNumbers,
FocusMonitorWorkspaceNumber and FocusNamedWorkspace SocketMessage
variants.

Largely a lift-and-shift from komorebi.

Had to implement some utility functions in MacosApi to retrieve a
monitor ID from the current cursor position.

None of the monitor-related system code has been tested on macOS since I
only have a single monitor to work with right now.
2025-09-19 11:03:30 -07:00
LGUG2Z e01fc55134 feat(wm): implement various ws config toggle cmds
This commit implements the ToggleWorkspaceWindowContainerBehaviour,
ToggleWorkspaceFloatOverride, ToggleLock, ToggleFloat, ToggleMonocle,
ToggleWindowContainerBehaviour, ToggleFloatOverride,
ToggleCrossMonitorMoveBehaviour, ToggleTiling and
ToggleWindowBasedWorkAreaOffset SocketMessage variants.

Again mostly a lift-and-shift from komorebi.

ToggleMaximizeWindow can be implemented later once I figure out how
maximized windows are handled in macOS.
2025-09-19 10:22:37 -07:00
LGUG2Z 4fc401cca8 feat(wm): implement layout cycling and flipping
Another lift and shift from komorebi to add support for the CycleLayout
and FlipLayout SocketMessage variants. Trying to get through all of the
main workspace-related interactive commands.
2025-09-19 09:49:27 -07:00
LGUG2Z c91520c531 feat(wm): implement container and focus promotion
Was going a little crazy without being able to promote a container to
the biggest tile. This is pretty much a straight lift and shift from
komorebi.
2025-09-19 09:41:14 -07:00
LGUG2Z c1cf94b23f feat(wm): implement resizing and retiling
This commit migrates the code from komorebi required to implement the
ResizeWindowEdge, ResizeWindowAxis, Retile and
RetileWithResizeDimensions SocketMessage variants, as well as the
related komorebic commands to emit those SocketMessages.
2025-09-19 09:33:56 -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 558a1578c8 feat(wm): implement monocle containers
This commit migrates the code around Monocle containers from komorebi
and implements everything needed to handle SocketMessage::ToggleMonocle
in the wm and send the SocketMessage from komorebic.

I think I should spend time implementing as many Workspace features as I
can before I turn my attention to anything else, because hunting for
where to re-introduce the monocle code I had previously omitted to get
everything compiling was quite tedious and I'm sure I've probably missed
things.
2025-09-18 17:14:24 -07:00
LGUG2Z 061d7e3e73 feat(wm): add basic workspace switching support
This commit migrates the code needed from komorebi to implement basic
workspace support.

The FocusWorkspaceNumber, MoveContainerToWorkspaceNumber and
SendContainerToWorkspaceNumber SocketMessage variants have been
implemented in process_command, and the commands to emit those
SocketMessage variants have been added to komorebic.

I took a stab at improving the code for hiding the windows by moving
them as off-screen as possible by taking inspiration of Aerospace's
approach of trying to leave only 1px of them visible.

Right now this always looks to put the hidden windows off-screen on the
left side of the screen.
2025-09-18 16:45:43 -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 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