From abfa8c6a5cdf0cd5e312e0b9c2080dc898f05f3f Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Tue, 27 Oct 2026 15:46:09 -0700 Subject: [PATCH] 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. --- README.md | 7 +- docs/cli/animation-style.md | 53 +++++ docs/dev/ARCHITECTURE.md | 23 +- docs/dev/DESIGN.md | 10 + docs/dev/PLATFORM.md | 16 +- docs/dev/vm-tests.md | 6 +- docs/usage/animation.md | 31 ++- docs/usage/configuration.md | 5 +- komorebi-client/src/lib.rs | 1 + komorebi/src/animation/mod.rs | 29 ++- komorebi/src/backend/mod.rs | 7 +- komorebi/src/border_manager/mod.rs | 56 ++++- komorebi/src/core/animation.rs | 250 ++++++++++++++++++++ komorebi/src/core/mod.rs | 3 + komorebi/src/kwin/effects.rs | 23 +- komorebi/src/process_command.rs | 21 +- komorebi/src/static_config.rs | 19 ++ komorebi/tests/animation.rs | 27 ++- komorebi/tests/animation_config.rs | 19 +- komorebi/tests/animation_stack.rs | 13 +- komorebic/src/main.rs | 24 +- komorebic/tests/cli.rs | 9 + nix/komorebi-options.nix | 65 ++++- nix/kwin-effect-geometry-change.nix | 4 + nix/kwin-effect-geometry-change/curve.patch | 61 +++++ nix/tests/effects.nix | 7 + nix/tests/vm/lib/komorebi_vm/pixels.py | 12 + nix/tests/vm/lib/tests/test_pixels.py | 11 +- nix/tests/vm/suites/commands/test.py | 1 + nix/tests/vm/suites/features/test.py | 101 ++++++-- nix/tests/vm/suites/look/test.py | 3 + schema.json | 229 +++++++++++++++++- 32 files changed, 1058 insertions(+), 88 deletions(-) create mode 100644 docs/cli/animation-style.md create mode 100644 komorebi/src/core/animation.rs create mode 100644 nix/kwin-effect-geometry-change/curve.patch diff --git a/README.md b/README.md index e3e14e6c..2babe4c0 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,8 @@ KWin: - `kwin-effect-geometry-change-komorebi` ([`nix/kwin-effect-geometry-change.nix`](nix/kwin-effect-geometry-change.nix)): Geometry Change 1.5, a scripted effect that animates a window that a program - or a script moves or resizes. + or a script moves or resizes, with a patch that makes its easing curve a + setting. Each one is a package for Linux and an attribute of `overlays.default`, built with the KWin of the nixpkgs the overlay is applied to. @@ -257,8 +258,8 @@ window, so the layout leaves the room while the compositor says it draws one, an komorebi gives each window the border color of what it is to the layout: the focused window, the others, a locked container, a floating window. `border`, `border-colour`, `border-width` and `border-offset` set it. Windows going to their places are -animated by another effect, Geometry Change, which `animation` and -`animation-duration` turn on and set. +animated by another effect, Geometry Change, which `animation`, +`animation-duration` and `animation-style` turn on and set. ## Documentation diff --git a/docs/cli/animation-style.md b/docs/cli/animation-style.md new file mode 100644 index 00000000..62065a3f --- /dev/null +++ b/docs/cli/animation-style.md @@ -0,0 +1,53 @@ +```text +Set the ease function for movement animations + +Usage: animation-style [OPTIONS] + +Options: + -s, --style