Files
komorebi/nix/kwin-effect-geometry-change/curve.patch
T
LGUG2Z abfa8c6a5c 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.
2026-10-28 07:20:49 -07:00

62 lines
2.6 KiB
Diff

curve.patch, for Geometry Change at revision 398491e
(https://github.com/peterfajdiga/kwin4_effect_geometry_change), applied by
nix/kwin-effect-geometry-change.nix. It adds a Curve setting: any of Qt's
easing curves by name (OutExpo, InOutSine, ...), which is how komorebi sets
the curve of its animations. An unknown or missing name is the effect's own
curve, OutExpo.
This patch is a derivative work of Geometry Change, which is distributed under
the GNU General Public License version 3, and it is distributed under the same
license.
SPDX-License-Identifier: GPL-3.0-only
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, version 3.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.
diff -ruN a/package/contents/code/main.js b/package/contents/code/main.js
--- a/package/contents/code/main.js 2026-10-26 21:55:40
+++ b/package/contents/code/main.js 2026-10-26 21:55:40
@@ -17,6 +17,12 @@
this.duration = animationTime(duration);
this.excludedWindowClasses = effect.readConfig("ExcludedWindowClasses", "krunner,yakuake").split(",");
this.crossFade = effect.readConfig("CrossFade", false);
+ // komorebi: any of Qt's easing curves by name ("OutExpo", "InOutSine", ...), which is how it
+ // says what its `animation.style` is; an unknown or missing name is the effect's own curve
+ this.curve = QEasingCurve[effect.readConfig("Curve", "OutExpo")];
+ if (this.curve === undefined) {
+ this.curve = QEasingCurve.OutExpo;
+ }
}
manage(window) {
@@ -128,7 +134,7 @@
animate({
window: window,
duration: this.duration,
- curve: QEasingCurve.OutExpo,
+ curve: this.curve,
animations: animations,
});
}
diff -ruN a/package/contents/config/main.xml b/package/contents/config/main.xml
--- a/package/contents/config/main.xml 2026-10-26 22:29:29
+++ b/package/contents/config/main.xml 2026-10-26 22:29:29
@@ -14,5 +14,8 @@
<entry name="CrossFade" type="Bool">
<default>false</default>
</entry>
+ <entry name="Curve" type="String">
+ <default>OutExpo</default>
+ </entry>
</group>
</kcfg>