This commit introduces the ability for users to specify colours in the
static config file in either RGB or Hex format.
This is done by introducing a new enum, Colour, which provides variants
wrapping the internal Rgb type, and the HexColour type from the
hex_colour crate. HexColour itself is wrapped in a new struct, Hex, in
order to allow the implementation of the JsonSchema trait.
A number of From<T> implementations have been done in order to make
working with the Colour enum more ergonomic.
Ultimately, the core representation for colours in komorebi remains the
Rgb struct, any and Hex-specified colours will be converted to this Rgb
type before being converted to u32 to pass them on to various Win32 API
calls.
This commit adds the "komorebic config" command as a helper to print the
path to komorebi.json, while respecting the KOMOREBI_CONFIG_HOME
environment variable if it exists.
This is particularly useful for users who wish to edit this file on the
command line, as they can now run commands like:
"lvim $(komorebic config)"
This commit addresses and number of bugs and improves the experience of
working with floating workspaces (ie. Workspace.tile = false).
- When the user moves or resizes a window on a floating workspace,
WindowManagerEvent::MoveResizeStart will no longer trigger, which
prevents the mouse focus from going to the middle of the window rect
after the resize or move action (if mouse_follows_focus = true)
- If active_window_border = true, it will no longer be shown on focused
windows in floating workspaces
- When windows are moved using a komorebic command from a floating
workspace to a tiling workspace and active_window_border = true, the
active window border will be shown again
This commit remove the socket connection retry loop in send_message
which is no longer required after @raggi's changes in
c8f6502b02.
@azinsharaf noticed that when trying to run komorebic commands while
komorebi was not accepting connections, multiple hanging komorebic
instances could be spawned, particularly if commands were retried.
@eythaann proposed an additive fix for this in PR684 but ultimately as
the previous race condition with the query/response commands has been
handed by @raggi we can remove the socket connection retry loop
completely.
This commit addresses a few bugs with regards to maximized window
handling.
- Correctly restoring and focusing when switching to a workspace
containing a window previously maximized with the toggle-maximize
command
- Unmaximizing a window during the initial window scan when the wm
initializes so that windows that are maximized before running komorebi
will no longer have the ugly white bar at the top
- When updating workspace layouts, windows that have been maximized
without using the komorebic toggle-maximize command will be
unmaximized to prevent the wm state drifting out of sync with what is
happening on the screen
This commit ensures that the focus changes to the appropriate window
when a container stack is being cycled through by a user who has
disabled the mouse_follows_focus feature.
fix#680
- Use a single thread to bind the hook, and then start dispatching.
- Use a blocking loop for message dispatching.
- Remove the locks around crossbeam channel, as it's already Send + Sync
This commit splits the komorebi crate into a mixed binary and library
crate.
All types and logic related to window management have been moved under
lib.rs, and are imported from there for use in main.rs, which is now
only responsible for starting and running the window manager process.
In preparation for exposing a new komorebi-client crate in the future,
serde::Deserialize has been derived on Notification and any struct that
may appear in a notification receievd by a process that has subscribed
to event updates.
re #659
This commit adds support for subscriptions via Unix Domain Sockets which
are better suited for IPC between Rust processes compared to Named Pipes
which have issues that I don't want to spend time resolving.
The main motivation for this change is to provide an easy way for the
new zebar project to consume information about komorebi's state in the
Rust backend so that a bar module can be created for komorebi users.
The next step in this process will be to finally refactor the komorebi
crate into a mixed bin/lib crate, and expose all notification-related
structs and maybe some connection helper methods in a new
komorebi-client crate.
The previous "subscribe" and "unsubscribe" komorebic commands have had
the "-pipe" suffix added to them, with aliases in place for the previous
names in order to ensure backwards compat.
Replace the client socket with replies sent on the other side of the
querying stream, for both UDS and TCP clients. This has two results:
unix socket clients such as komorebic no longer race on the socket bind,
fixing the out of order bind error, and the response mixup conditions
that could occur. Queries over TCP now receive replies over TCP, rather
than replies being sent to a future or in-flight command line client.
This commit ensures that the $Env:LOCALAPPDATA/komorebi dir is created
by the quickstart command, as it cannot be assumed that this will always
exist, especially on new machines with recent versions of Windows 11.
fix#671
This commit is a fix that handles a subtle breaking change in
sysinfo::Process:root() which no longer can be used to see if a process
is a scoop shim.
Instead we can stringify the executable path and see if the absolute exe
path contains the substring "shims".
With this fix duplicate process detection is once again working
correctly.
This commit ensures that the KOMOREBI_CONFIG_HOME environment variable is recognized by the
komorebic check command and the static config loader when used to specify the location of the
applications.yaml file.
resolve#660