mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-12-03 21:54:27 +01:00
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).
60 lines
2.3 KiB
Nix
60 lines
2.3 KiB
Nix
# A real Plasma Wayland session that logs in by itself, on a machine that can draw. Everything the
|
|
# headless node has is here too, so a test can still start a virtual KWin next to it. The module's
|
|
# unit, `komorebi.service`, starts komorebi in the session when the user logs in, as on a user's
|
|
# machine; a suite that wants the session without it sets `services.komorebi.enable = false` in
|
|
# its `node`.
|
|
#
|
|
# The choice of login manager is made here and nowhere else. nixpkgs' own `plasma6` test uses
|
|
# plasma-login-manager, so that is what this node follows; sddm with a Wayland greeter is the other
|
|
# one that has been seen to work, and replacing the first block below with
|
|
# `services.displayManager.sddm = { enable = true; wayland.enable = true; };` and
|
|
# `services.displayManager.defaultSession = "plasma";` switches to it.
|
|
{ pkgs, ... }:
|
|
{
|
|
imports = [ ./headless.nix ];
|
|
|
|
# the one display this node has is the one screenshots are taken of
|
|
komorebi.vm.renderNode = false;
|
|
|
|
services.xserver.enable = true;
|
|
services.displayManager = {
|
|
plasma-login-manager.enable = true;
|
|
autoLogin = {
|
|
enable = true;
|
|
user = "komorebi";
|
|
};
|
|
};
|
|
|
|
virtualisation = {
|
|
memorySize = 4096;
|
|
cores = 4;
|
|
};
|
|
|
|
# An idle lock screen or a dimmed display changes what a screenshot shows, and a display that has
|
|
# gone to sleep gets no frame callbacks from KWin, so clients stop answering resizes.
|
|
environment.etc."xdg/kscreenlockerrc".text = ''
|
|
[Daemon]
|
|
Autolock=false
|
|
LockOnResume=false
|
|
'';
|
|
environment.etc."xdg/powerdevilrc".text = ''
|
|
[AC][Display]
|
|
DimDisplayWhenIdle=false
|
|
TurnOffDisplayWhenIdle=false
|
|
|
|
[AC][SuspendAndShutdown]
|
|
AutoSuspendAction=0
|
|
'';
|
|
|
|
environment.systemPackages = [ pkgs.kdePackages.konsole ];
|
|
|
|
# KWin loads no effect that animates under software rendering, which is all a guest has, unless
|
|
# it is told to: with this it loads Geometry Change, which komorebi asks it to load
|
|
environment.sessionVariables.KWIN_EFFECTS_FORCE_ANIMATIONS = "1";
|
|
|
|
# Nothing adds a display device here (see komorebi.vm.renderNode above). The test driver gives
|
|
# every aarch64 guest a virtio-gpu, and an x86_64 guest has the default VGA; screenshots are taken
|
|
# of that one, and a second device would be a second head that KWin draws on and the screenshot
|
|
# never shows.
|
|
}
|