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.
This commit makes the komorebic promote-swap command reversible by
storing the previous container index in the Workspace state.
If the current container index is the same as the layout's primary
index, and there is a previous promotion swap container index available,
the two containers at those indices will be swapped, effectively making
a second call to promote-swap an undo.
This commit adds a new SocketMessage variant PromoteSwap and
corresponding komorebic promote-swap command.
PromoteSwap will also promote the focused window container to the
largest tile in the layout, but instead of removing the focused
container x from the Ring and inserting it into position 0, possibly
changing the positions of other windows between 0 and x, the indices x
and 0 in the Ring will be swapped directly.
Implements the equivalent of
https://github.com/LGUG2Z/komorebi/commit/18ee6678962bc31a39ce59fd4a1f6a9ee752ac5c
This commit makes the `stack-all` command simpler, by simply making a
`VecDeque` with all the tiled windows of the workspace, then it creates
a new container with that `VecDeque` and changes the workspace
containers to be just this new container which has all the windows in
it.
Then and only then do we focus and show the previously focused window
and hide all the rest.
This way we don't have a bunch of `FocusChange`/`Cloak`/`Uncloak` events
coming up which might conflict with each other when the user has
transparency and animations enabled.
With this commit, there will only be one focus event for the focused
window and one cloak event for each of the other windows.
This commit adds visual feedback in the form of a ghost tile for
preselections made by the preselect-direction command.
A container with the id "PRESELECT" will be added to the workspace, and
replaced when the next manage-able window is spawned.
A new command, cancel-preselect has been added to remove both the
preselection index and the ghost tile if the user changes their mind.
This commit expands the hack introduced in 4d25d4e which deals with
inconsistent window titles returned by apps from different macOS APIs.
The same issue that was happening with Activity Monitor was also
happening with Google Chrome, so this hack has been updated to a more
general "contains" check.
This commit adds a new feature to preselect the direction of the next
spawned window with a corresponding komorebic preselect-direction
command which takes an OperationDirection.
If the OperationDirection is valid from the current position, it will be
stored in the Workspace state, and then read, applied, and deleted when
the next manage-able window is spawned.
I was running komorebi on a MacBook Pro today and ended up quite quickly
being able to reproduce the ws switching loops that I thought I had
fixed (well, I still can't reproduce them on my Mac Mini).
This commit adds an additional cooldown period of 1s to
workspace_reconciliator::send_notification, which seems to do the trick
for me on the MacBook Pro.
This commit makes some small tweaks to account for the hiding and
showing of partially visible windows on the Scrolling layout.
This can happen when resize dimensions have been applied which leaves
only a certain percentage of the window within the work area.
If a window is only partially within the work area, the call to hide
will silently fail.
In order to deal with this there is some jank added when hiding
workspaces and updating workspaces to see if we are leaving a Scrolling
workspace with a partially-visible window, and if we are, to reposition
that window to be fully on within the work area before hiding it.
This commit makes a small improvement to the Scrolling layout by hiding
windows to which layouts which are not contained within the horizontal
bounds of the work area would otherwise be applied.
This should also allow this layout to now be useable on configurations
using multiple monitors.
This commit adds a border_radius configuratino option which defaults to
10, which matches the uniform radius on Sequoia. Tahoe is a mess, but
people can at least specify their own preferred border radius value now.
Eventually we should look up the radius of each individual window when
creating the borders like JankyBorders does (I think?)
I was running into this a lot when debugging the WindowServer memory
ballooning issue fixed in the last commit - the title returned by
CGWindowListCopyWindowInfo and the title returned by kAXWindowsAttribute
for Activity Monitor differs, so when restarting komorebi, if Activity
Monitor is open, it wouldn't get managed.
Added a little hack as a workaround for now.
This commit wraps the various lifecycle methods for border creation,
update and destruction in autoreleasepools to ensure that WindowServer
memory doesn't balloon.
This commit adds a new LayoutOptions option, GridLayoutOptions,
currently with a single configurable "rows" opt which can be use to
constrain the grid by number of rows.
Calibre was being very weird and failing layout updates when a menu
button was clicked (#justcalibrethings) so I've added a final window
validity escape hatch check to the reaper for now.
This commit fixes a difference between netdev on Windows and macOS,
where matching needs to be done against the Friendly Name of an
interface on Windows, but against the Name on macOS.
This commit adds a new option under layout_options.scrolling -
"center_focused_column", which defaults to false. When
set to true, and when the number of scrolling columns is an odd number
>=3, komorebi will, if there are enough windows being managed on the
workspace, and if the focused window is not too close to either the
beginning or the end of the workspace ring, keep the focused window in a
centered position in the layout
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.
Mainly a cleanup PR - there were some subtle bugs introduced trying to
exclude the ManualNotification for cmd+tab focus changes, but since this
is all being delegated to the workspace reconciliator now, we can remove
those confusing matches! guards and that variant all together.
Screen locking and unlocking is a bit weird in macOS because it's
implemented as a separate app which is activated and deactivated, so
unique events for screen lock and unlock are never emitted by the
system.
This commit encapsulates the logic to detect the relevant events on the
loginwindow into the creation of ScreenLock and ScreenUnlock
WindowManagerEvent variants.
Hello infinite workspace switching loop, my old friend.
Reimplemented the old workspace reconciliator from komorebi for Windows
with additional source debouncing and tested by furiously mashing alt-1
and alt+2 for 20s. No loop!
Stupid Apple stuff. Something was up with Messages leaving a ghost tile
when being closed by the red dot vs. cmd+w - this change fixes that, but
will probably break something else.
This commit adds a new monitor configuration option
"window_hiding_position", which takes an enum with the variants
BottomLeft and BottomRight.
Until now the behaviour had been hard-coded to hide windows at the
bottom left of every monitor.
If no value is given on a monitor configuration object, this option will
default to BottomLeft.