Centralized both KomorebiTheme and KomobarTheme in the komorebi-themes
module in komorebi for Windows.
This commit removes the duplicated references in komorebi for Mac and
just pulls in those; now we only have to update the docs in one place.
Regenerated all the schemas after pulling in the changes.
This commit optimizes the objc2 dependency tree by disabling default
features and enabling only the minimal set of features actually used
by the codebase. This reduces compilation time and dependency bloat.
I was meant to do this earlier but during the initial implementation it was
easier to just pull in everything. Now that we are getting ready for a public
release it's time to improve on this.
I ended up:
* Removing unused direct dependencies:
- objc2-core-services
- objc2-core-video
* Setting `default-features = false` on all objc2 crates and added only
the specific features required for the types and methods used
* Updating objc2, objc2-app-kit, objc2-foundation,
objc2-application-services, objc2-core-foundation, objc2-core-graphics,
and objc2-quartz-core with minimal feature sets
After all those changes, the following transitive dependencies are no longer
pulled in: objc2-metal, objc2-core-image, objc2-core-data, objc2-cloud-kit,
objc2-core-text, and loads of unused Foundation/AppKit class bindings.
Some before and after numbers:
| Metric | Before | After | Change |
|---------------------------------|---------|---------|----------|
| objc2 dep lines (komorebi) | 84 | 50 | -40.5% |
| objc2 dep lines (komorebi-bar) | 91 | 59 | -35.2% |
| Dependency tree (komorebi) | 973 | 917 | -5.8% |
| Dependency tree (komorebi-bar) | 1181 | 1131 | -4.2% |
| Clean build time | 3m 05s | 2m 21s | -23.8% |
The almost 24% reduction in clean build time is a big win!
This commit adds a new workspace crate, version, which is consumed by
komorebi and komorebic.
If either of those binaries are being built by
the Nix Flake, the git rev info will be pulled from inputs.self.rev
instead of querying the git repo, because the git files are not passed
to the derivation.
The build.rs for the version crate decides if the build is happening by
querying the shadow-rs build output for BRANCH, which will always be
empty when a "nix build" is running.
Cargo builds will use the standard git information retrieval mechanisms
in shadow-rs.
The information in both cases is exposed as version::LONG_VERSION, and
passed to clap as the string to return when either binary is called with
the --version flag.
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.
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.
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".
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.