mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-22 08:31:50 +01:00
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:
1 parent
22c14ba5be
commit
4fa8108110
41 files changed
+1322
-93
No files matched your search
@@ -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.
|
||||
@@ -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 |
|
||||
|
||||
Reference in new issue
Block a user