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.
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.