Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

358.13. kdos-kwin-motion-1.0.0

KDOS CRT motion for KWin — windows unfold and fold, the splash powers on, logout powers down

Version 1.0.0, release 1
Source tree src/desktop/kdos-kwin-motion/
Phase 50_desktop (Desktop), 68 of 92 in build order
Licence MIT
Homepage https://github.com/kunaldawn/kdos
Build time 0.1 SBU
Installed size 18.4 KiB in 10 files
Recipe src/desktop/kdos-kwin-motion/kpkgbuild

About

kdos-kwin-motion is the motion of Phosphor mode: three KWin effects written in JavaScript, each a KWin/Effect package under /usr/share/kwin/effects/, that move windows the way the KDOS boot splash moves the screen.

All three are off by default and are switched on and off together by kdos phosphor, which also turns the stock login and sessionquit off while Phosphor mode is on. The collapse of the whole screen at lock and logout is not here: a JavaScript effect draws only windows, so that belongs to the kdos_crt effect that kwin carries.

The port is KDOS’s own data with no upstream source. build.sh configures CMakeLists.txt with extra-cmake-modules and KPackage, which installs each package directory and copies the one fold shader into both effects that use it.

Why it is in KDOS

The comment above the 4 ports from kdos-kwin-motion to kwin-script-kdos-window-memory in script/phases/50_desktop/packages.txt:

KWin's KDOS pieces: the CRT motion effects, the key card on Meta+F1, run-or-raise for the terminal programs and the window position memory.

Sources

None: the port builds from its own directory, /kdos/src/desktop/kdos-kwin-motion.

Dependencies

Depends on: cmake, ninja, extra-cmake-modules, kpackage, kwin.

Required by (1): kde-plasma.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/50_desktop/phase.env && kpkg install kdos-kwin-motion'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /kdos/src/desktop/kdos-kwin-motion.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/kdos-kwin-motion
SRC=$SRC_ROOT/kdos-kwin-motion-1.0.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

cmake -S "$PORT_SRC" -B build -G Ninja \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D KDE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/kdos-kwin-motion, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf kdos-kwin-motion-1.0.0-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/kdos-kwin-motion, and runs the triggers its paths call for.

Other files in the port directory, read by build.sh: CMakeLists.txt, kdos_login/, kdos_quit/, kdos_unfold/, shaders/.

Contents

Installed directories: /usr/share/kwin/effects/kdos_login, /usr/share/kwin/effects/kdos_quit, /usr/share/kwin/effects/kdos_unfold.

Notes

The effects have no tie to KWin’s C++ interface, so a KWin release does not rebuild or break them. What they rely on is the scripted-effect interface: addFragmentShader(), ShaderUniform animations, the open and close grab roles, and the uniforms KWin sets on a window shader (modulation, saturation, the colour-management block). A change there shows as a script error in KWin’s log and a window that opens without the motion, never as a window that fails to open.

Every duration goes through animationTime(), so AnimationDurationFactor in kdeglobals scales it and 0 turns the motion off; the desktop hold in kdos_quit is not motion and keeps its 30 seconds. KWin gives a scripted effect animationsSupported() as its supported(), which is false when KWin’s EGL device reports itself as software. A software device that does not say so, as Mesa’s kms_swrast may not, would load them, so kdos phosphor on switches them on only after kdos_crt, which also refuses llvmpipe, softpipe and Software Rasterizer by the renderer’s name, has loaded: they are seen only with GPU rendering, make run-hw or the rig’s --gl.

Each shader works in KWin’s colour-managed space, decoding the window to nits and encoding it again for the output, so the beam’s light is the output’s own white and an HDR or night-light output draws it correctly.