feat(kwin): easing curves for animations

An animation that moves a window at one pace all the way looks flat, and the
stock Geometry Change has one curve, an exponential ease out. The patched effect
reads a Curve setting, the name of one of Qt's easing curves. komorebi's styles
are those curves with Ease in front, so the look the backend is asked for names
the curve as Qt does, and the effect's settings have it next to the duration. A
cubic Bezier, which only a configuration can say, is not one of Qt's curves and
is an ease out. With the stock effect every style is that ease out.

komorebic gets animation-style, for every animation or the movement of windows
alone. vm-features puts two curves a few seconds into a 30 s move of the same
window and checks that they are in different places.

The animation key of komorebi.json takes a style too, 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 4fa8108110
commit abfa8c6a5c
32 files changed
+1058 -88

No files matched your search

+26 -5
View File
@@ -2,7 +2,8 @@
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.
that a program or a script moves or resizes, and komorebi tells it how long the animation lasts
and how it eases.
Animation is off by default.
## Installing the effect
@@ -41,23 +42,43 @@ 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.
## Easing
[`komorebic animation-style`](../cli/animation-style.md) sets the curve a window follows to its
place: `linear` by default, or one of the easings by name (`ease-out-expo`, `ease-in-out-sine`,
`ease-out-bounce`, ...; `komorebic animation-style --help` lists them). They are Qt's easing
curves, and a style is Qt's name for the curve with the "Ease" taken off (`EaseInOutSine` is
`InOutSine`). Like the others, it takes `--animation-type movement`.
```sh
komorebic animation-style --style ease-out-expo
komorebic animation-style --style ease-in-out-sine --animation-type movement
```
The stock Geometry Change always eases out exponentially. The build the flake installs also reads
the curve, which is what lets a style other than that one take effect; with the stock effect every
style looks like an ease out. A cubic Bézier, which only a configuration can name, is not one of
Qt's curves and is drawn as an ease out too.
## 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`.
`enabled`, `duration` and `style`, 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
"duration": 400,
"style": "EaseOutExpo"
}
}
```
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.
the settings as they are, and one with it that leaves out `duration` or `style` leaves that one as
it is.
## What is animated
+3 -2
View File
@@ -113,11 +113,12 @@ runs.
|---|---|---|
| `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 |
| `style` | `Linear` | The easing curve, in the same two forms: a name such as `EaseOutExpo`, or a cubic Bézier as four numbers ([Animation](animation.md#easing)) |
| `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.
settings as they are, and one that has it and leaves out `duration` or `style` leaves that one as it
is; a value given for every kind of animation takes the settings of single kinds away.
### Rules