feat(kwin): animation through the Geometry Change effect

Windows that jump to their new places are hard to follow. komorebi animates
nothing itself: KWin's Geometry Change effect animates a window that a script
moves, and komorebi tells it how long that takes. The look the window manager
asks the backend for now has an animation, a duration that the settings give for
every kind of animation or, when one is set for the movement of windows, for
that one. The KWin backend writes the effect's settings into the user's kwinrc
(a duration, and no cross-fading, since a window going to its place changes
where it is and not what it shows), loads the effect when animation is on, and
unloads it and puts the settings back when it is off or komorebi exits.

komorebic gets animation, animation-duration and animation-fps. The module
installs the effect (effects.animation), and the session node sets the variable
that makes KWin load effects that animate under software rendering. vm-look
reads the screen a moment after a flip of the layout, with a 30 s animation and
without one.

The commands that change a stack turn the animation off while they run, as
komorebi does elsewhere, and komorebi.json takes an animation key (enabled,
duration and fps, each for every kind of animation or for one).
This commit is contained in:
LGUG2Z committed 2026-10-28 07:20:49 -07:00
1 parent 22c14ba5be
commit 4fa8108110
41 files changed
+1322 -93

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
```text
Set the duration for movement animations in ms
Usage: animation-duration [OPTIONS] <DURATION>
Arguments:
<DURATION>
Desired animation durations in ms
Options:
-a, --animation-type <ANIMATION_TYPE>
Animation type to apply the duration to. If not specified, sets global duration
[possible values: movement]
-h, --help
Print help
```
+14
View File
@@ -0,0 +1,14 @@
```text
Set the frames per second for movement animations
Usage: animation-fps <FPS>
Arguments:
<FPS>
Desired animation frames per second
Options:
-h, --help
Print help
```
+19
View File
@@ -0,0 +1,19 @@
```text
Enable or disable movement animations
Usage: animation [OPTIONS] <BOOLEAN_STATE>
Arguments:
<BOOLEAN_STATE>
[possible values: enable, disable]
Options:
-a, --animation-type <ANIMATION_TYPE>
Animation type to apply the state to. If not specified, sets global state
[possible values: movement]
-h, --help
Print help
```
+40 -14
View File
@@ -68,9 +68,10 @@ grows with the code: each part of the daemon that is added has its place here.
- **Notification**: what a subscriber is sent after each event and each message the window
manager handles: the event or the message, and the state after it ([`Notification`]).
- **Look**: how the compositor is asked to dress the windows, which it draws ([`Look`]):
a border, with its width, its corner radius and two colors.
a border, with its width, its corner radius and two colors, and the animation of windows going
to their places, with its duration.
- **Effect**: a plugin of the compositor that changes how windows are drawn. KDE Rounded Corners
is the effect that draws the border.
is the effect that draws the border, and Geometry Change the one that animates windows.
- **Compositor**: the program that owns the screen and the windows. On KDE Plasma it is
KWin.
- **Backend**: the implementation of the [`Backend`](../../komorebi/src/backend/mod.rs)
@@ -765,14 +766,21 @@ goes the other way, for `GenerateStaticConfig`.
komorebi decides what the windows look like and the compositor draws it, since only the
compositor has the frames, the corners and the shadows. A border is the outer outline of a window,
drawn outside it, in the gap the layout leaves between tiles. The window manager describes a
drawn outside it, in the gap the layout leaves between tiles, and an animation is a window
sliding to its new place instead of jumping there. The window manager describes a
[`Look`] and asks the backend for it ([`Backend::apply_look`]); the backend sees that it is drawn
and answers whether borders are being drawn. The reasons are in
[DESIGN.md](DESIGN.md#why-does-the-compositor-draw-the-borders-and-not-komorebi).
[`border_manager`] holds the settings, as statics that the messages `Border`, `BorderWidth` and
`BorderOffset` set: whether borders are on, their width, the offset, the radius of the corners and
the two colors. [`border_manager::current_look`] makes the [`Look`] of them, and
[`border_manager`] holds the settings of the border, as statics that the messages `Border`,
`BorderWidth` and `BorderOffset` set: whether borders are on, their width, the offset, the radius
of the corners and the two colors. [`animation`] holds the settings of the animation, which
`Animation`, `AnimationDuration` and `AnimationFps` set: whether windows are animated and for how
long, for every kind of animation or for one ([`AnimationPrefix`]; movement is the only kind). The
settings of one kind win over the global ones, and a global setting clears the ones of the kinds.
The commands that change a stack turn the animation off while they run and put it back, as
komorebi does on the other platforms; the file's `animation` key sets the same settings.
[`border_manager::current_look`] makes the [`Look`] of them all, and
[`border_manager::send_notification`] asks the backend for it and keeps the answer in
[`BORDER_DRAWN`]. It is called before the first layout, after every event and every message, and
after every retile. A backend remembers the look it applied last and does nothing when it is asked
@@ -800,7 +808,10 @@ into the user's `kwinrc`, group `[Round-Corners]`, through [`Kwinrc`]; loads the
(`reconfigureEffect`), since KWin hands an effect the copy of `kwinrc` it read when it started. A
look without a border unloads the effect, if komorebi loaded it, and puts the user's settings
back. `shutdown` does the same. An effect KWin did not find when it started is reported once and
komorebi goes on without it, with `apply_look` answering false. The stock effect has one color for
komorebi goes on without it, with `apply_look` answering false. The animation is Geometry Change:
its `Duration` is the look's, and cross-fading is off. KWin animates what is painted, so the
frame the table reads is the final one at once and nothing waits for an animation to end. The
stock border effect has one color for
the active window and one for the others; komorebi's build of it takes a color for each window,
over D-Bus, by the UUID KWin knows the window by. `set_border_colours` answers false, and logs it
once, when the effect is the stock one: every border is then the focused or the unfocused color of
@@ -814,10 +825,11 @@ The flake exports one module under two names, `nixosModules.default` and
`komorebi-full` (both programs) with the flake's nixpkgs and Rust toolchain. Its options are
`enable`, `package` (by default `pkgs.komorebi-full`, from the overlay), `logLevel`,
`configFile`, `config`, `applicationSpecificConfiguration`, `effects.borders.enable` and
`effects.borders.package` (by default `pkgs.kde-rounded-corners-komorebi`, from the overlay), and
`execStart`, which is read-only: the module sets it to `bin/komorebi` of the package with
`--log-level`, and `--config` with a `komorebi.json` when `configFile` or `config` is set. `config`
is typed from
`effects.borders.package` (by default `pkgs.kde-rounded-corners-komorebi`, from the overlay),
`effects.animation.enable` and `effects.animation.package`
(`pkgs.kwin-effect-geometry-change-komorebi`), and `execStart`, which is read-only: the module
sets it to `bin/komorebi` of the package with `--log-level`, and `--config` with a
`komorebi.json` when `configFile` or `config` is set. `config` is typed from
`nix/komorebi-options.nix`, the options `schemars-nixgen` makes from the schema of `komorebi.json`;
the module writes it as JSON, with no null in it, and `configFile` and the written file both go
through `check-jsonschema` against `schema.json` when the system is built (comment lines taken out
@@ -827,7 +839,8 @@ fetched from GitHub that become `app_specific_configuration_path`; the module ha
With `services.komorebi.enable`, the module:
- installs the package in the system profile, and the effect that draws the borders unless
`effects.borders.enable` is off;
`effects.borders.enable` is off and the one that animates windows unless
`effects.animation.enable` is off;
- defines the user unit `komorebi.service`, which every user of the machine has. Plasma's
`plasma-workspace.target` wants it, so a Plasma session starts it at login, and it is ordered
after `plasma-core.target`, which Plasma orders after KWin's service, `plasma-kwin_wayland`;
@@ -852,6 +865,7 @@ module's unit.
| `komorebi` and `komorebic` are on every user's `PATH` | the module installs the package in the system profile | `nixos-module-eval`; every VM suite runs `komorebic` | none |
| The border effect is installed with komorebi, and only by the module | the module installs `effects.borders.package` in the system profile when `effects.borders.enable` is set | `nixos-module-eval` ("the border effect is installed in the system profile", "with the border effect off, komorebi is installed and the effect is not"), `vm-look` | `effects.borders.enable = false` |
| The border effect the module installs is built for the KWin of the system and is not loaded until komorebi asks | the package: `kde-rounded-corners-komorebi` links the `libkwin` of the nixpkgs' KWin and says `EnabledByDefault` false in its metadata | the `kde-rounded-corners-komorebi-install` check | `effects.borders.package` |
| The animation effect is installed with komorebi, and not loaded until komorebi asks | the module installs `effects.animation.package` when `effects.animation.enable` is set, and the package's metadata says `EnabledByDefault` false | `nixos-module-eval` ("the animation effect is installed in the system profile", "with the animation effect off, ..."), the `kwin-effect-geometry-change-komorebi-install` check, `vm-look` | `effects.animation.enable = false` |
| Every Plasma session starts komorebi, once KWin's service has started | systemd: the user unit is wanted by `plasma-workspace.target`, after `plasma-core.target` | `nixos-module-eval`, `vm-module` | `systemctl --user mask komorebi` |
| A daemon that fails or is killed is started again | systemd: `Restart=on-failure` | `vm-module` (`SIGKILL`) | none |
| A daemon that is told to stop stays stopped, and the unit is not failed | systemd: the exit statuses of `Stop` (0) and of `SIGTERM` (130) are successes | `vm-module` | none |
@@ -899,6 +913,7 @@ module's unit.
how it is loaded, reloaded and generated.
- [`border_manager`](../../komorebi/src/border_manager/mod.rs): the border settings, and the
[`Look`] they make, which it asks the backend for.
- [`animation`](../../komorebi/src/animation/mod.rs): the animation settings, which the look has.
- [`kwin::effects`](../../komorebi/src/kwin/effects.rs): the KWin effect that draws the border,
its settings and the state komorebi keeps of it.
- [`process_command`](../../komorebi/src/process_command.rs): the thread that listens on the
@@ -1044,6 +1059,9 @@ the fake. The window manager is its only caller, through [`backend`]. The contra
| No outline is drawn inside a window, and a border is never thicker than the effect can draw | framework path: [`kwin::effects`](../../komorebi/src/kwin/effects.rs) sets every inner outline to 0 and clamps the width to 20 | `the_border_is_the_outer_outline_and_nothing_is_drawn_inside_the_window`, `a_border_thicker_than_the_effect_can_draw_is_the_thickest_it_can`, `vm-look` | none |
| Every window has the border color of what it is to the layout, and a window whose kind changes has the new one at once | framework path: [`border_manager::update_colours`] is called after every event and every message, from [`border_manager::window_kinds`], and the backend sends the colors it did not send last time | `the_focused_window_has_the_focus_colour_and_the_others_do_not`, `a_locked_container_that_is_not_focused_is_marked`, `a_stack_has_its_own_colour_when_it_has_the_focus`, `a_monocled_window_has_the_monocle_colour`, `a_floating_window_has_the_floating_colour_while_it_has_the_focus`, `border_colours_are_a_command_only_when_they_change`, `vm-features` (section C) | the stock effect: two colors for every window |
| With borders off no window has a color | framework path: [`border_manager::update_colours`] tells the backend an empty list when `BORDER_ENABLED` is false | `with_borders_off_no_window_has_a_colour` | none |
| The settings of one kind of animation win over the global ones, and a global setting clears them | framework path: the arms of [`WindowManager::process_command`] for `Animation` and `AnimationDuration`, and [`animation::movement_animation`], which reads the kind's setting before the global one | `the_animation_messages_set_the_animation_and_the_compositor_is_asked_for_it` | none |
| A command that changes a stack is carried out with the animation off, and the animation is on again after it | framework path: the arms of [`WindowManager::process_command`] for the stack messages swap `ANIMATION_ENABLED_GLOBAL` for false and put the value back | `the_animation_is_on_again_after_a_command_that_changes_a_stack` | none |
| The `animation` key of the file is the animation settings, and a file without it leaves them | framework path: `StaticConfig::apply_globals` sets them only when the key is there, and `duration` only when the key has one | `the_animation_key_of_the_file_is_the_animation_settings` | none |
| The effect komorebi loaded is unloaded, and the user's settings of it are put back, when komorebi stops using it or exits | framework path: the effect's state unloads what komorebi loaded, and [`Kwinrc`] puts the group back | `one_group_can_be_put_back_while_the_others_stay_changed`, `vm-look` | `SIGKILL`: the next run puts the settings back when it stops |
| Queries never block on the compositor | convention only | none | the KWin backend's `cursor_pos` waits up to 250 ms |
| Only the backend module reaches the compositor | convention only | none | none |
@@ -1166,13 +1184,18 @@ A window is shown, and ends up on a tile:
- [`nix/kde-rounded-corners.nix`](../../nix/kde-rounded-corners.nix): the build of the KWin
effect that draws an outline around each window, with
[`komorebi-border-colours.patch`](../../nix/kde-rounded-corners/komorebi-border-colours.patch),
which lets komorebi give each window a color; and
which lets komorebi give each window a color;
[`nix/kwin-effect-geometry-change.nix`](../../nix/kwin-effect-geometry-change.nix), the
effect that animates a window going to its place; and
[`nix/tests/effects.nix`](../../nix/tests/effects.nix), the checks of the files each effect
package installs.
- [`komorebi/tests/borders.rs`](../../komorebi/tests/borders.rs) and
[`komorebi/tests/border_commands.rs`](../../komorebi/tests/border_commands.rs): the room a drawn
border takes, and the messages that set the border, against the fake;
[`komorebi/tests/border_colours.rs`](../../komorebi/tests/border_colours.rs) and
[`komorebi/tests/animation.rs`](../../komorebi/tests/animation.rs), the messages that set the
animation, [`komorebi/tests/animation_config.rs`](../../komorebi/tests/animation_config.rs), its
key of the file, and [`komorebi/tests/animation_stack.rs`](../../komorebi/tests/animation_stack.rs),
the stack commands that turn it off; [`komorebi/tests/border_colours.rs`](../../komorebi/tests/border_colours.rs) and
[`komorebi/tests/borders_off.rs`](../../komorebi/tests/borders_off.rs), the color of each
window's border, and none with borders off;
[`nix/tests/vm/suites/look`](../../nix/tests/vm/suites/look/test.py), the border in a real
@@ -1262,6 +1285,9 @@ A window is shown, and ends up on a tile:
[`border_manager::current_look`]: ../../komorebi/src/border_manager/mod.rs
[`border_manager::send_notification`]: ../../komorebi/src/border_manager/mod.rs
[`BORDER_DRAWN`]: ../../komorebi/src/border_manager/mod.rs
[`animation`]: ../../komorebi/src/animation/mod.rs
[`animation::movement_animation`]: ../../komorebi/src/animation/mod.rs
[`AnimationPrefix`]: ../../komorebi/src/animation/prefix.rs
[`Backend::set_border_colours`]: ../../komorebi/src/backend/mod.rs
[`border_manager::window_kinds`]: ../../komorebi/src/border_manager/mod.rs
[`border_manager::update_colours`]: ../../komorebi/src/border_manager/mod.rs
+18 -1
View File
@@ -390,7 +390,8 @@ then, and KDE Rounded Corners at its defaults draws a one pixel black outline ov
bar of every window. Built with `EnabledByDefault` false, an effect is loaded only when
something asks for it with `loadEffect`, which can come after its settings are written. That
KWin then starts without the effect and loads it when asked was measured before the package
was written ([PLATFORM.md](PLATFORM.md#kwin-effects)).
was written ([PLATFORM.md](PLATFORM.md#kwin-effects)). Geometry Change ships disabled by
default, and its check asserts it, so that an update of the effect cannot change it unseen.
## Why does the compositor draw the borders, and not komorebi?
@@ -434,6 +435,22 @@ active window" and "the others". komorebi's build of KDE Rounded Corners takes a
window over D-Bus, through KWin's name ([PLATFORM.md](PLATFORM.md#the-patches)). Without that
build every kind falls back to the two colors of the look, and komorebi says so once in its log.
## Why does komorebi animate nothing itself?
Because the compositor draws the windows: an animation komorebi made would be a series of frames
asked of KWin, each a command, where the Geometry Change effect animates what is painted, in the
compositor, at the refresh rate of the screen. komorebi tells the effect how long an animation
lasts ([`border_manager::current_look`](../../komorebi/src/border_manager/mod.rs)). That is why
`animation-fps` is accepted and does nothing, and why the frame KWin reports for a window is the
final one from the start of the animation: the effect moves what is painted and not the window
([PLATFORM.md](PLATFORM.md#kwin-effects)).
## Why is cross-fading off?
Because cross-fading the old contents of a window into the new while it changes size is the
effect's default, and it costs a redraw of both. A window going to its place is a move and a
resize, and what the window shows does not change.
## Why are the effects patched?
Because the stock effects lack what komorebi needs of them. Each patch leaves the effect
+52 -10
View File
@@ -141,7 +141,8 @@ sends another window there.
When borders are on, it also asks KWin to load KDE Rounded Corners, the effect that draws them,
after writing the effect's settings into `kwinrc`, and asks it to read them again
([KWin effects](#kwin-effects)). An effect KWin did not find is reported once in the log.
([KWin effects](#kwin-effects)). It does the same with Geometry Change, the effect that animates
windows, when animation is on. An effect KWin did not find is reported once in the log.
Every command of the window manager (move and resize, focus, raise, hide or restore, minimize,
bring back, maximize, unmaximize or close a window, show a workspace on an output, put a window
@@ -169,13 +170,13 @@ an owner again; the VM test `vm-kwin-restart` restarts KWin twice under a runnin
When it is stopped with `SIGINT`, `SIGTERM` or a `Stop` message on its socket, it brings back
the windows it hid, waits until the commands that do so have reached the bridge, removes the
parking desktop, unloads the border effect, if komorebi loaded it, puts back the values the keys it
set in `kwinrc` had (`PerOutputVirtualDesktops`, and the keys of the border effect), or removes a
key the user had not set, and asks KWin to reload its configuration, asks KWin to unload the
script, closes an empty connection to each subscriber, and removes the socket. The desktops it
created for workspaces stay: they are the user's desktops from then on. A `StopIgnoreRestore`
message stops it the same way, except that it does not bring the windows back: the parking desktop
is removed all the same. The file `bridge.js` stays in the runtime
parking desktop, unloads the effects it loaded, puts back the values the keys it set in `kwinrc`
had (`PerOutputVirtualDesktops`, and the keys of the effects), or removes a key the user had not
set, and asks KWin to reload its configuration, asks KWin to unload the script, closes an empty
connection to each subscriber, and removes the socket. The desktops it created for workspaces
stay: they are the user's desktops from then on. A `StopIgnoreRestore` message stops it the same
way, except that it does not bring the windows back: the parking desktop is removed all the same.
The file `bridge.js` stays in the runtime
directory, which is removed at logout. A daemon that is killed leaves the script running in
KWin, reporting to nobody, the socket file in the runtime directory, per-output desktops
on, and the parking desktop with the hidden windows on it, until the next start replaces the
@@ -226,7 +227,7 @@ What komorebi calls:
| `org.kde.KWin` | `/Scripting/Script<id>` | `org.kde.kwin.Script` | `run()` | after `loadScript` |
| `org.freedesktop.DBus` | `/org/freedesktop/DBus` | `org.freedesktop.DBus` | `AddMatch(s)`, for the signal `NameOwnerChanged` | at start, to see KWin leave the bus and come back |
| `org.kde.kglobalaccel` | `/component/kwin` | `org.kde.kglobalaccel.Component` | `invokeShortcut(s)`, with `MoveMouseToFocus` | when the pointer follows the focus |
| `org.kde.KWin` | `/Effects` | `org.kde.kwin.Effects` | `isEffectSupported(s)`, `isEffectLoaded(s)`, `loadEffect(s)`, `unloadEffect(s)`, `reconfigureEffect(s)`, with `kwin4_effect_shapecorners` | when the look changes (the border is turned on, off or changed), and at exit |
| `org.kde.KWin` | `/Effects` | `org.kde.kwin.Effects` | `isEffectSupported(s)`, `isEffectLoaded(s)`, `loadEffect(s)`, `unloadEffect(s)`, `reconfigureEffect(s)`, with `kwin4_effect_shapecorners` and `kwin4_effect_geometry_change` | when the look changes (the border is turned on, off or changed), and at exit |
| `org.kde.KWin` | `/org/komorebi/BorderColours` | `org.komorebi.BorderColours1` | `SetColours(asau)`: the UUID of each window and its color, `0xRRGGBB` | when the color of a window's border changes; the object is komorebi's build of the border effect ([The patches](#the-patches)) |
| `org.kde.KWin` | `/KWin` | `org.kde.KWin` | `reconfigure()` | after komorebi changed `kwinrc`, at start and at exit |
| `org.kde.KWin` | `/VirtualDesktopManager` | `org.kde.KWin.VirtualDesktopManager` | the properties `desktops` and `count`, `createDesktop(us)`, `setDesktopName(ss)`, `removeDesktop(s)` | when a workspace has no desktop, and at start; `createDesktop` also for the parking desktop, the first time a window is hidden, and `removeDesktop` for it when komorebi stops and for one a killed run left |
@@ -243,6 +244,7 @@ since a read right after `createDesktop` has to see the new desktop.
| `$XDG_CONFIG_HOME/autostart/komorebi.desktop` (`~/.config/autostart/komorebi.desktop`) | the XDG autostart entry `komorebic enable-autostart` writes: `Exec=komorebi`, or `komorebi --config "FILE"`, and `X-KDE-autostart-after=plasma-workspace`, which a Plasma session starts komorebi from at login | the user's; `komorebic disable-autostart` removes it |
| `$XDG_CONFIG_HOME/kwinrc` (`~/.config/kwinrc`) | KWin's configuration: komorebi sets `PerOutputVirtualDesktops=true` in `[Windows]`, changing that line or adding it and nothing else, and writes the file beside it first and renames it over it | put back as it was when the daemon stops |
| `$XDG_CONFIG_HOME/kwinrc`, group `[Round-Corners]` | the settings of the border effect, written when borders are on ([KWin effects](#kwin-effects)) | put back, with the rest of `kwinrc`, when borders are turned off and when the daemon stops |
| `$XDG_CONFIG_HOME/kwinrc`, group `[Effect-kwin4_effect_geometry_change]` | the settings of the animation effect, written when animation is on | put back as above, when animation is turned off and when the daemon stops |
| `$XDG_RUNTIME_DIR/komorebi/kwinrc-backup.json` | the value each key of `kwinrc` had before komorebi first changed it | removed when the values are put back; one a crash left behind is used by the next run |
| `$XDG_RUNTIME_DIR/komorebi/bridge.js` | the script KWin loads, with its configuration (the D-Bus names and the hold time of `Poll`) on its first line | written at every start; the directory is removed at logout |
| `$XDG_RUNTIME_DIR/komorebi/komorebi.sock` | the command socket | bound once the daemon is connected to KWin, after a file left there is removed; removed when the daemon stops |
@@ -293,6 +295,14 @@ The logs are written to `$XDG_DATA_HOME/komorebi` (`~/.local/share/komorebi` if
write to stops it at once. When `XDG_RUNTIME_DIR` is not set, the bridge and the socket go
there too.
### `KWIN_EFFECTS_FORCE_ANIMATIONS`
KWin's own variable, read by KWin and not by komorebi. With software rendering, which is all a
virtual machine has, KWin loads no effect that animates, Geometry Change included, unless it is
`1` in KWin's environment: at time of writing (2026-10-27) a guest loaded 11 effects without it and
29 with. The VM nodes set it ([Rendering](#rendering-in-virtual-machines-and-over-rdp)); a machine
with a GPU needs nothing.
### `RUST_LOG`
Which log lines the daemon prints, in the syntax of `tracing-subscriber`'s `EnvFilter`
@@ -408,6 +418,7 @@ patches (see [The patches](#the-patches)):
| Package | Effect | Plugin id | Installed as |
|---|---|---|---|
| `kde-rounded-corners-komorebi` | [KDE Rounded Corners](https://github.com/matinlotfali/KDE-Rounded-Corners) 0.11.0, which draws an outline around each window | `kwin4_effect_shapecorners` | a C++ plugin, `lib/qt-6/plugins/kwin/effects/plugins/kwin4_effect_shapecorners.so` |
| `kwin-effect-geometry-change-komorebi` | [Geometry Change](https://github.com/peterfajdiga/kwin4_effect_geometry_change) 1.5 (revision `398491e`), which animates a window that a program or a script moves or resizes | `kwin4_effect_geometry_change` | a scripted effect, `share/kwin/effects/kwin4_effect_geometry_change/` |
Each package is in the flake's `packages` for Linux and in `overlays.default`, which builds it
with the `callPackage` of the nixpkgs it is applied to, so that it follows that nixpkgs' KWin.
@@ -441,6 +452,20 @@ At time of writing (2026-10-27):
- **KDE Rounded Corners draws its outer outline in the window's shadow**: its shader stops
where the window's texture is transparent. A window without a shadow has no outer outline,
and the outline is at most 20 px thick.
- **Geometry Change ships disabled by default**: its `metadata.json` has
`"EnabledByDefault": false`, which the check asserts. It loads on `loadEffect`, and under
software rendering only with `KWIN_EFFECTS_FORCE_ANIMATIONS=1` in KWin's environment (see
[Rendering](#rendering-in-virtual-machines-and-over-rdp)): without it, a session in a
virtual machine loads 11 effects instead of 29.
- **Geometry Change animates what a program or a script asks for**: a move and a resize made
through KWin's scripting API are animated, and by its source an interactive move or resize
is not. It eases out exponentially (`QEasingCurve.OutExpo`), so the movement is nearly
over after a third of its duration. Its settings are in the
`[Effect-kwin4_effect_geometry_change]` group of `kwinrc` (`Duration`, `CrossFade`,
`ExcludedWindowClasses`), and it reads them again on `reconfigureEffect`: a `Duration` of
4000 written while it ran was the length of the next animation.
- **The animation moves what is painted, not the window**: the frame KWin reports for the
window (`frameGeometry`) is the final one from the start of the animation.
### What komorebi writes for the border
@@ -467,7 +492,7 @@ and unfocused colors, and not inside the frame.
Each patch is a derivative work of the effect it changes, and is under the same license, the
GNU General Public License version 3; its header states the license and describes the
change. The check of each package asserts that its patch is in the build.
change. The check of a patched package asserts that the patch is in the build.
[`komorebi-border-colours.patch`](../../nix/kde-rounded-corners/komorebi-border-colours.patch),
for KDE Rounded Corners, makes two changes:
@@ -489,6 +514,23 @@ for KDE Rounded Corners, makes two changes:
contents change or the window is resized, so a change of opacity alone would not show. The
patched effect redirects the window again when its opacity changes.
### What komorebi writes for the animation
Geometry Change reads its settings from the group `[Effect-kwin4_effect_geometry_change]` of
`kwinrc`:
| Key | Value |
|---|---|
| `Duration` | the animation's duration, in milliseconds |
| `CrossFade` | `false`: a window that changes size is not cross-faded |
komorebi then calls `reconfigureEffect`, and at time of writing (2026-10-27) the effect uses the
new `Duration` for the next move: a `Duration` of 4000 written while it ran was the length of the
next animation. An animation cannot be seen in a screenshot of a short one: the screenshot takes
seconds, and the effect eases out exponentially, nearly over after a third of its duration. A
screenshot of a session a few seconds into a 30 s animation shows a window that has not got to its
place, and the same move with animation off is there at once.
## Rendering in virtual machines and over RDP
At time of writing (2026-10-27):
+2 -1
View File
@@ -59,7 +59,8 @@ explains the files of rules for particular applications it can name.
[Quickstart and autostart](usage/quickstart-and-autostart.md) explains how to write an example
configuration, how to start komorebi with Plasma without the module, and how to replace the
configuration of a running daemon.
[Borders](usage/borders.md) explains how komorebi has KWin draw a border around each window.
[Borders](usage/borders.md) explains how komorebi has KWin draw a border around each window, and
[Animation](usage/animation.md) how it has KWin animate the windows going to their places.
[Subscribing to notifications](usage/subscribing-to-notifications.md) explains how a program
such as a status bar follows what komorebi does. The [CLI reference](cli/start.md) has a page
for every `komorebic` command, generated from its help.
+10 -6
View File
@@ -56,9 +56,10 @@ the repository's `rust-toolchain.toml` selects, whatever nixpkgs your system use
- It installs `komorebi` and `komorebic` in the system profile, so they are on every user's
`PATH`.
- It installs KDE Rounded Corners, the KWin effect that draws komorebi's borders, unless
`services.komorebi.effects.borders.enable` is `false`. KWin finds effects when it starts, so a
session that was running when you switched to the new configuration has the borders after the
next login.
`services.komorebi.effects.borders.enable` is `false`, and Geometry Change, the effect that
animates windows, unless `services.komorebi.effects.animation.enable` is `false`. KWin finds
effects when it starts, so a session that was running when you switched to the new
configuration has them after the next login.
- It defines a systemd user unit, `komorebi.service`, for every user of the machine. Plasma's
`plasma-workspace.target` starts it when a user logs in to a Plasma session, after
`plasma-core.target`, which Plasma orders after KWin. The unit runs the daemon with the `PATH`
@@ -81,6 +82,8 @@ the repository's `rust-toolchain.toml` selects, whatever nixpkgs your system use
| `services.komorebi.applicationSpecificConfiguration` | `enable = true`, `sources = [ ]` | Files of [application specific configuration](usage/application-specific-configuration.md) fetched from GitHub (`owner`, `repo`, `rev`, `path` and `hash` each), which become the `app_specific_configuration_path` of the configuration `config` makes. There are none by default. |
| `services.komorebi.effects.borders.enable` | `true` | Installs the KWin effect that draws komorebi's borders. Whether borders are drawn is komorebi's own setting ([Borders](usage/borders.md)). KWin finds effects when it starts: log in again after the first switch. The module warns when `config` sets `border` to `true` and this is off. |
| `services.komorebi.effects.borders.package` | `pkgs.kde-rounded-corners-komorebi` | The effect: KDE Rounded Corners 0.11.0, built against the KWin of the system and not loaded until komorebi asks. |
| `services.komorebi.effects.animation.enable` | `true` | Installs the KWin effect that animates komorebi's windows going to their places. Whether windows are animated is komorebi's own setting ([Animation](usage/animation.md)). KWin finds effects when it starts: log in again after the first switch. |
| `services.komorebi.effects.animation.package` | `pkgs.kwin-effect-geometry-change-komorebi` | The effect: Geometry Change, a scripted effect that is not loaded until komorebi asks. |
| `services.komorebi.execStart` | read only | The command line the unit starts komorebi with, built from `package`, `logLevel` and `configFile` or `config`. A unit of your own that runs komorebi uses it to start komorebi the same way. |
`config` takes the keys of `komorebi.json` ([Configuration](usage/configuration.md)) as Nix, and a
@@ -138,15 +141,16 @@ doing, and its log.
### The packages without the module
The flake's packages are `komorebi`, `komorebic`, and `komorebi-full`, which has both and is the
`default`, and `kde-rounded-corners-komorebi`, the effect that draws the borders. To install them without the unit, and start komorebi yourself:
`default`, `kde-rounded-corners-komorebi`, the effect that draws the borders, and
`kwin-effect-geometry-change-komorebi`, the effect that animates windows. To install them without the unit, and start komorebi yourself:
```sh
nix profile install github:LGUG2Z/komorebi-for-kde
```
On a NixOS configuration, the overlay, `overlays.default`, provides `pkgs.komorebi`,
`pkgs.komorebic`, `pkgs.komorebi-full` and `pkgs.kde-rounded-corners-komorebi` for
`environment.systemPackages`.
`pkgs.komorebic`, `pkgs.komorebi-full`, `pkgs.kde-rounded-corners-komorebi` and
`pkgs.kwin-effect-geometry-change-komorebi` for `environment.systemPackages`.
## Other distributions: from source
+74
View File
@@ -0,0 +1,74 @@
# Animation
komorebi can have a window slide to its new place when the layout changes, instead of jumping
there. It does not animate anything itself: a KWin effect, Geometry Change, animates a window
that a program or a script moves or resizes, and komorebi tells it how long the animation lasts.
Animation is off by default.
## Installing the effect
The effect is not part of KWin, and KWin finds effects when it starts: log out and in again after
installing it. On NixOS the flake's module installs it with komorebi, which is what
`services.komorebi.effects.animation.enable` does (it is on by default); the effect is built so
that KWin does not load it until komorebi asks.
[`installation.md`](../installation.md) has the module's options.
komorebi loads the effect when animation is turned on, and unloads it when it is turned off or
komorebi exits. A machine that does not have the effect has no animation: komorebi says so once
in its log, and windows jump to their places.
## Turning it on, and how long it lasts
[`komorebic animation`](../cli/animation.md) turns animation on or off, and
[`komorebic animation-duration`](../cli/animation-duration.md) sets how long it lasts, in
milliseconds: 250 by default.
```sh
komorebic animation enable
komorebic animation-duration 400
komorebic animation disable
```
Both take `--animation-type movement` to set the animation of windows going to their places apart
from the global setting, which is how the settings of one kind of animation win over the global
ones. Movement is the only kind there is. A global setting takes the settings of the kinds away.
```sh
komorebic animation enable --animation-type movement
komorebic animation-duration 600 --animation-type movement
```
[`komorebic animation-fps`](../cli/animation-fps.md) is accepted and does nothing: KWin animates
at the refresh rate of the screen.
## In komorebi.json
The `animation` key of [`komorebi.json`](configuration.md#animation) has the same settings:
`enabled` and `duration`, each either one value for every kind of animation or a value for each
kind (`{ "movement": true }`), and `fps`.
```json
{
"animation": {
"enabled": true,
"duration": 400
}
}
```
The file sets them when the daemon starts and when the file changes. A file without the key leaves
the settings as they are, and one with it that leaves out `duration` leaves the duration as it is.
## What is animated
What is painted moves; the window does not. The frame KWin reports for a window, and so the frame
komorebi reads back, is the final one from the start of the animation, so komorebi never waits for
an animation to end. The window is not cross-faded as it changes size: it is a move and a resize,
not a change of what the window shows. An interactive move or resize by the user is not animated.
While the effect is loaded, windows that other programs move are animated too.
## What is put back
The effect keeps its settings in the user's `kwinrc`, in the group
`[Effect-kwin4_effect_geometry_change]`. komorebi writes them when it asks for the animation, and
when it exits or animation is turned off it puts back what the user had there.
+16 -2
View File
@@ -38,8 +38,8 @@ trailing commas.
Reading the file again sets every setting of the daemon from it, and a key the file leaves out is
the default of the setting: a `resize-delta` given with a command is gone when the file changes.
These stay as they were when the file leaves them out: `default_workspace_padding`,
`default_container_padding`, `display_index_preferences` and the four settings of the borders.
The rules add up, as
`default_container_padding`, `display_index_preferences`, the four settings of the borders and the
animation, when the file has no `animation`. The rules add up, as
[Rules](#rules) says. A workspace the file lists gets its name, padding, offsets and rules from
its entry, and its layout when the entry names one; a workspace the file does not list is left as
it is.
@@ -105,6 +105,20 @@ can have values of their own, which come before the default.
`komorebic border`, `border-width` and `border-offset` change the first three while the daemon
runs.
### Animation
`animation` is an object with these keys:
| Key | Default | What it does |
|---|---|---|
| `enabled` | `false`, required | Whether windows are animated going to their places: `true` or `false` for every kind of animation, or `{ "movement": true }` for the kinds it names |
| `duration` | `250` | How long the animation lasts, in milliseconds, in the same two forms |
| `fps` | `60` | Accepted and not used: KWin animates at the refresh rate of the screen |
[Animation](animation.md) explains what is animated. A file that has no `animation` leaves the
settings as they are, and one that has it and leaves out `duration` leaves the duration as it is;
`enabled` and `duration` given for every kind of animation take the settings of single kinds away.
### Rules
| Key | What it does |