Commit Graph

1164 Commits

Author SHA1 Message Date
LGUG2Z
cc51f62c3a chore(release): v0.1.33 v0.1.33 2025-01-11 13:33:13 -08:00
Csaba
b1db417df5 feat(bar): opt to hide battery widget when charged 2025-01-09 15:49:51 -08:00
LGUG2Z
996a556984 chore(clippy): apply new rust 1.84.0 lints 2025-01-09 15:48:41 -08:00
LGUG2Z
c71e61fb1e chore(deps): cargo update 2025-01-08 21:39:21 -08:00
LGUG2Z
2d97ee101d feat(config): use global padding when omitted on ws
Simplifying my software for the masses
2025-01-08 20:47:16 -08:00
LGUG2Z
a4f69238b7 fix(wm): preserve new padding when loading state
This commit is a follow up to 7bf1521363,
ensuring that if a user has changed global padding options, that they
will be preserved from the initialized window manager state and applied
on top of the dumped state which is being restored.
2025-01-08 20:24:23 -08:00
alex-ds13
96f7eb1d31 fix(bar): apply position on start
For some reason, when calling the `window.set_position` when creating
the Komobar or even when applying the config on the first frame the
actual EGUI's window size wasn't changing. This commit adds a new field
to `Komobar` called `size_rect` so that we can store the expected size
rect of the window according to the config, so that we don't have to be
calculating it all the time. This field is updated on `apply_config`.

Now on `update` of the bar we check if the current size using the EGUI
Context is the expected `size_rect`, if it is we do nothing, if it is
not we update the bar position. This makes sure that on start the bar
will resize to the users config correctly! Now the resize of the bar
only happens here.

This commit also adds the `hwnd` field to `Komobar` so that we don't
have to be calling `process_hwnd()` all the time.
2025-01-07 16:39:38 -08:00
LGUG2Z
28cd4a8801 fix(wm): skip destroyed windows on rule enforcement
This commit introduces an if let binding to only process windows which
still exist when attempting to enforce workspace rules.

Previously, calls to functions such as Window::exe might have returned
an error if a window which had been destroyed but not yet removed from
the state was examined by the enforce_workspace_rules fn. Now, such
windows will fail the if let binding and be skipped entirely, eventually
being removed by the core event processing loop.
2025-01-04 21:14:33 -08:00
LGUG2Z
3aa92a1255 feat(bar): add update widget
This commit adds a new widget, "Update", which will check for komorebi
version updates using the cargo package version of the running binary
and the latest release returned from the GitHub API.

If the latest release is newer than the current cargo package version, a
widget will be shown, which can be clicked to open the changelog of the
latest release.
2025-01-04 21:14:33 -08:00
LGUG2Z
281980b010 fix(wm): avoid obvious border manager thread crash
This commit adds an early exit from the border manager's event
processing loop whenever a window which still exists in the state but
has been destroyed is encountered. Instead of returning an error, the
'containers loop will now skip ahead to the next iteration.

This commit also makes an adjustment to the frequency with which the
reaper sends border manager notifications - a single notification is now
sent at the end of each iteration if necessary, rather than one
notification per workspace.
2025-01-04 21:14:33 -08:00
LGUG2Z
c063302c91 feat(cli): add stackbar-mode command
This commit adds a new komorebic command "stackbar-mode" to allow users
to change stackbar modes programmatically.
2025-01-04 21:14:33 -08:00
LGUG2Z
ba52dc3378 fix(wm): add uncloak as a notif override event
If a user triggers the workspace reconciliator by clicking on an app in
the start bar or via alt-tab, a notification should be sent to
subscribers such as komorebi-bar so that the focused workspace can be
updated.

The various komorebi reconciliators and manager modules don't emit
events to subscribers themselves (yet?), so for now we can pass on the
uncloak event.

Maybe we can look into expanding the Notification enum in the future.

fix #1211
2025-01-04 21:14:33 -08:00
LGUG2Z
44716fdc98 fix(wm): avoid focused ws rule enforcement deadlock
This commit adds mutex lock scoping in
WindowManager::enforce_workspace_rule to avoid a deadlock when
should_update_focused_workspace evaluates to true.

fix #1212
2025-01-04 21:14:33 -08:00
LGUG2Z
4b30cecba9 feat(config): allow specifying layout flip on ws
This commit adds support for specifying a layout flip axis for each
workspace in the static configuration file.
2025-01-04 21:14:33 -08:00
LGUG2Z
d45cd729e8 feat(cli): allow checking of arbitrary config files
This commit adds an optional --komorebi-config flag to the check command
to allow users to check a komorebi.json file in an arbitrary location.
2025-01-04 21:14:27 -08:00
LGUG2Z
5a8f48c6b9 chore(dev): begin v0.1.33-dev 2025-01-03 18:20:23 -08:00
LGUG2Z
4b9d811499 chore(release): v0.1.32 v0.1.32 2025-01-01 11:23:43 -08:00
LGUG2Z
d520a2bf74 docs(mkdocs): run docgen 2025-01-01 10:43:19 -08:00
LGUG2Z
7ef4fd81c0 feat(cli): add version update checks
This commit adds version update checks and feedback to the komorebic
start and check commands.
2024-12-31 10:58:25 -08:00
LGUG2Z
083ab65077 feat(docs): individual commercial use licensing
This commit updates various docs with information on the long-promised
individual commercial use license which will be available to purchase
from 01 Jan 2025 onwards.
2024-12-31 10:02:40 -08:00
LGUG2Z
e9bb6b43d6 feat(cli): add eager-focus command
This commit adds a new komorebic command "eager-focus", which takes a
full case-sensitive exe identifier as an argument. When komorebi
receives this message, it will look through each monitor and workspace
for the first matching managed window and then focus it.

This allows users who have well defined workspaces and rules to bind
semantic hotkeys to commands like "komorebic eager-focus Discord.exe" to
immediately jump to applications instead of mentally looking up their
assigned workspaces or positions within container stacks.
2024-12-29 12:29:23 -08:00
LGUG2Z
79eda30f48 feat(config): add matchers for removing titlebars
This commit adds a new field to the static config file, "remove_titlebar_applications", which allows
users to now use the full range of matching strategies to identify applications for which titlebars
should be removed. This is heavily discouraged for a number of reasons, and is unlikely to work with
a wide range of applications which now draw their own titlebar regions. The previous advice to use
in-application configuration settings to hide title bars if they exist is still valid.

resolve #805
2024-12-27 11:37:00 -08:00
alex-ds13
692da90890 feat(wm): allow reapplying initial workspace rules
This commit adds the following new socket messages and commands:
- `EnforceWorkspaceRules`: resets the `already_moved_window_handles` and
  calls `enforce_workspace_rules` so that all workspace rules, including
  initial workspace rules are applied again
- `enforce-workspace-rules`: cli command which sends the
  EnforceWorkspaceRules socket message
2024-12-26 14:16:25 -08:00
alex-ds13
4babf336ec fix(bar): prevent komorebi connection from staling
Sometimes the bar would randomly stop receiving notifications from
komorebi and would stop updating the `Komorebi` widget.

This feels to me that the reason is the same one that used to happen on
the `process_commands` from `komorebi` where the socket would get stuck
reading an empty connection.

This commit adds a read timeout to the socket to prevent that from
happening and hopefully it should stop those situations where the bar
would stop receiving notifications.
2024-12-26 14:16:13 -08:00
LGUG2Z
53a83eedb5 chore(deps): cargo update 2024-12-26 13:59:38 -08:00
dependabot[bot]
e1bbd3c1f5 chore(deps): bump houseabsolute/actions-rust-cross from 0 to 1
Bumps [houseabsolute/actions-rust-cross](https://github.com/houseabsolute/actions-rust-cross) from 0 to 1.
- [Release notes](https://github.com/houseabsolute/actions-rust-cross/releases)
- [Changelog](https://github.com/houseabsolute/actions-rust-cross/blob/v0/Changes.md)
- [Commits](https://github.com/houseabsolute/actions-rust-cross/compare/v0...v1)

---
updated-dependencies:
- dependency-name: houseabsolute/actions-rust-cross
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-26 13:59:38 -08:00
LGUG2Z
2c08fbe8f6 fix(wm): focus prev idx when closing workspace 2024-12-23 16:56:22 -08:00
Csaba
cced2a4433 feat(bar): added icon_scale to the config allowing a custom value between 1.0 and 2.0 2024-12-22 15:00:11 -08:00
alex-ds13
d93b6fa1b3 fix(bar): update widgets background color properly
Previously when changing between themes with different backgrounds the
widget's background color was not updating because they take the bg
color from the `RenderConfig` which was only being updated on
`apply_config`, now we also pass the `RenderConfig` to the `apply_theme`
function and update it's `background_color` there as well.
2024-12-21 08:53:01 -08:00
Csaba
99353b8064 fix(bar): network widget spacing 2024-12-19 21:01:11 -08:00
LGUG2Z
c64a42bca5 chore(deps): bump egui to v0.30 2024-12-19 17:00:41 -08:00
alex-ds13
5ab5ec4f3a fix(bar): apply theme on first frame
On some computers the context colors were being reset on the very first
frame. So now we try to apply the theme on the first frame and
afterwards we only do it again when there is a config change or a theme
socket message.
2024-12-19 16:39:35 -08:00
alex-ds13
ad08585faf fix(bar): use layout on Area to prevent shaking
There were some cases were the bar was showing some shaking, turns out
that using `ui.with_layout` instead of `ui.horizontal_centered` removes
this shaking, so this commit makes that change and uses the
`right_to_left` layout on the right widgets again, meaning that we need
to reverse them again.
2024-12-19 16:39:35 -08:00
alex-ds13
eb8a988841 fix(bar): fix background color clobbering 2024-12-19 16:39:35 -08:00
alex-ds13
0e2a55b300 fix(bar): apply roundings on komorebi.json change
Group roundings were getting lost when applying the theme after a
`komorebi.json` change/save trigger. Now we reapply these groupings on
the `apply_theme` to make sure they are always correct.
2024-12-19 16:39:35 -08:00
alex-ds13
eda91dcd1d fix(bar): use bg color before applying transparency 2024-12-19 16:39:35 -08:00
alex-ds13
0c6317a27b fix(bar): use correct transparency_alpha
Previously when reading the `theme` from `komorebi.json` it was also
getting the transparency_alpha from the `StaticConfig`, this is wrong,
it should use the alpha from the bar config. This commit fixes that.
2024-12-19 16:39:35 -08:00
alex-ds13
5c81a8c9e2 fix(bar): apply work_area_offset on config change 2024-12-19 16:39:35 -08:00
alex-ds13
a4128b7276 fix(bar): handle komorebi theme change properly
Previously if we changed/set the theme on `komorebi.json` it would apply
that theme to the bar without taking into account the transparency
alpha, also after removing the `theme` from `komorebi.json` file it
wasn't applying the theme from the bar config. This commit fixes these
issues.
2024-12-19 16:39:35 -08:00
alex-ds13
73a4df884c fix(bar): use the frame.inner_margin config 2024-12-19 16:39:35 -08:00
alex-ds13
32a234317c fix(bar): actually save the config on apply_config 2024-12-19 16:39:35 -08:00
alex-ds13
0dc6780da6 fix(bar): normalize areas of widgets
This commit changes the way each of the 3 parts of potential widgets
(left, center and right) is created so that they are all done on the
same way and look the same. It is using `Area` with different anchors
for each part which makes the widgets actually center vertically
properly.

This created an issue with the `Bar` grouping. To fix it we've made the
`Bar` grouping change the outer panel frame instead of creating an
actual group. This has the side effect (or maybe feature!) of losing the
background of the outer frame. Meaning this outer frame will now have
the look of the `Bar` grouping only. Currently it is using a fixed outer
margin but this can be changed in the future to a config option.
2024-12-19 16:39:35 -08:00
alex-ds13
f089d3e59b feat(wm): allow stopping without restoring windows
This commit creates a new `SocketMessage` called `StopIgnoreRestore`
which makes komorebi stop without calling `window.restore()` on all
windows. This way every maximized window will stay maximized once you
start komorebi again and it is able to use the previous `State`.

If it fails to restore the previous state you might have to call
`komorebic restore-windows` in case you had hidden windows, for example
when when using the `window_hiding_behaviour` as `Hide`, or you can
simply unminimize them if you were using `Cloak` or `Minimize`.
2024-12-18 08:19:21 -08:00
LGUG2Z
5dbf0f1b89 docs(schema): update all json schemas 2024-12-17 19:38:30 -08:00
alex-ds13
d393f8fe77 feat(bar): add two new display format types
This commit adds two new `DisplayFormat` types:
- `TextAndIconOnSelected`: which displays icon and text for the selected
  element and the other elements only have text.
- `IconAndTextOnSelected`: which displays icon and text for the selected
  element and the other elements only have icon.
2024-12-17 16:00:08 -08:00
alex-ds13
c3769e7881 feat(bar): optional workspaces on Komorebi widget
This commit makes the `workspaces` on `Komorebi` widget optional. This
way it allows adding the `workspaces` on one Alignment and the
`focused_window` on another one, for example.
2024-12-17 14:43:59 -08:00
Csaba
3c0b12f9af feat(bar): scale icon size with font size
This commit changes the way icons are displayed on the bar.

There was an issue with how app icons were sized using shrink_to_fit.

This has been changed to use fit_to_exact_size instead, relying on the
font size as a starting point and scaling it to 1.4 of its size, making
the icons to appear larger.

The same scaling was done to all the widget icons as well to make them
look unified.
2024-12-17 12:58:36 -08:00
alex-ds13
804faef229 fix(wm): focus and update after apply state
This commit makes sure we focus the previously focused workspace on all
monitors, load it and update it and in the end focus the actual focused
monitor and workspace pair calling `update_focused_workspace` to make
sure it updates the workspace and gives focus to the focused window.
2024-12-17 11:51:55 -08:00
LGUG2Z
7bf1521363 feat(wm): dump and load previous instance state
This commit adds changes to the main wm process to dump a state file to
temp_dir() when the process is exited either via komorebic stop or
ctrl-c, and to automatically try to reload that dumped state file if it
exists on the next run.

A new flag "--clean-state" has been added to both komorebi.exe and the
komorebic start command to override this behaviour.

The dumped state file can only be applied if the number of connected
monitors matches the number of monitors recorded in the state, and if
every HWND listed in the state file still exists.

This is validated by calling Window.exe(), which under the hood checks
for the continued existence of the process associated with the HWND.

Only the "workspace" subsection of the state for each matching
connecting monitor will be applied.
2024-12-17 08:33:02 -08:00
LGUG2Z
b49e634b65 feat(wm): add transparency config to global state
This commit adds various transparency related global configuration
values to GlobalState, which is can be queried via the komorebic
global-state command.

resolve #1182
2024-12-16 18:54:29 -08:00