354.27. krohnkite-0.9.10.0
Dynamic tiling for KWin, a KWin script with twelve layouts, shipped disabled
| Version | 0.9.10.0, release 1 |
| Shelf | kde — KDE Plasma and Gear platform pieces outside Frameworks that have no other domain: KIO workers, thumbnailers, Plasma integration, KDE Wayland glue |
| Phase | 50_desktop (Desktop), 50 of 92 in build order |
| Licence | MIT |
| Homepage | https://codeberg.org/anametologin/Krohnkite |
| Build time | 0.1 SBU |
| Installed size | 708.6 KiB in 40 files |
| Recipe | ports/core/kde/krohnkite/kpkgbuild |
About
Kröhnkite is a dynamic tiling script for KWin: new windows take their place in a layout (tile, monocle, three-column, spiral, quarter, stacked, columns, spread, stair, binary tree, cascade or floating), and keyboard shortcuts move, resize and swap them. The port is the maintained fork on Codeberg. It installs as a KWin/Script package under /usr/share/kwin/scripts/krohnkite/, and KWin loads it only while kwinrc [Plugins] krohnkiteEnabled is true; its metadata does not enable it by default, and /usr/share/kdos/xdg/kwinrc sets it false, so it ships off. kdos tiling on (or Meta+Shift+T), the Desk page of the Welcome tour and System Settings’ KWin Scripts page turn it on (see kdos tiling). It is meaningful only under KWin, so the port is built in 50_desktop.
Why it is in KDOS
The comment above it in script/phases/50_desktop/packages.txt:
Dynamic tiling as a KWin script, shipped disabled.
Sources
krohnkite-0.9.10.0.tar.gz(726.8 KiB)
sha256aea49af7dae5216026e1c9d5d66edef5bc842cb0c662e484a3e1cd9afbb6d241
upstream: https://codeberg.org/anametologin/Krohnkite/archive/0.9.10.0.tar.gz
archive copy: sources-3/kde--krohnkite-0.9.10.0.tar.gzkrohnkite-vendor-0.9.10.0.tar.xz(1.9 MiB)
sha2568c8f44f91c71914ebb22ba329617ae63793c7af82e0a0f60d46b8e7c6d3e078f
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-3/kde--krohnkite-vendor-0.9.10.0.tar.xz
Dependencies
Depends on: nodejs, make, kwin, libplasma, plasma5support, plasma-workspace, python3, xdg-utils.
Required by (2): kde-plasma, kdos-plasma-look.
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 krohnkite'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/kde/krohnkite.
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.
cd /ports/core/kde/krohnkite
echo 'aea49af7dae5216026e1c9d5d66edef5bc842cb0c662e484a3e1cd9afbb6d241 krohnkite-0.9.10.0.tar.gz' | sha256sum -c -
echo '8c8f44f91c71914ebb22ba329617ae63793c7af82e0a0f60d46b8e7c6d3e078f krohnkite-vendor-0.9.10.0.tar.xz' | sha256sum -c -
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/krohnkite
SRC=$SRC_ROOT/krohnkite-0.9.10.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf krohnkite-0.9.10.0.tar.gz -C "$SRC" --strip-components=1
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 recipe’s helpers _rev and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
tar xf "$PORT_SRC/$name-vendor-$version.tar.xz"
export PATH="$SRC/node_modules/.bin:$PATH"
tsc
make pkg PROJECT_VER="$version" PROJECT_REV="$_rev"
install -d "$PKG/usr/share/kwin/scripts"
cp -r pkg "$PKG/usr/share/kwin/scripts/krohnkite"
install -Dm644 res/appicon/krohnkite.svg "$PKG/usr/share/icons/hicolor/scalable/apps/krohnkite.svg"
for f in res/layouts/*.svg; do
install -Dm644 "$f" "$PKG/usr/share/icons/hicolor/scalable/actions/krohnkite-layout-${f##*/}"
done
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/krohnkite, 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 krohnkite-0.9.10.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/krohnkite, and runs the triggers its paths call for.
Contents
Installed directories: /usr/share/kwin/scripts/krohnkite, /usr/share/licenses/krohnkite.
Notes
The script is written in TypeScript. build.sh compiles it with the TypeScript compiler from a node vendor bundle, which holds that one package at the version upstream’s package-lock.json pins, and runs it from node_modules/.bin with nodejs; nothing reaches the network. Upstream’s Makefile then lays out the package: make pkg copies the QML, the compiled krohnkite.js as contents/code/script.js and the configuration schema into pkg/, and writes metadata.json from res/metadata.json with the version and the short commit id filled in. The Makefile reads both from git, which a release tarball has none of, so the recipe passes them as PROJECT_VER and PROJECT_REV, the second from the _rev helper. The .kwinscript attached to upstream’s release is the same tree zipped, plus the Russian and Chinese catalogues, which the English-only rule leaves out (see Size and language policy). A bump updates _rev to the new tag’s commit.
When the script loads, it runs its own contents/code/install-icons.py through Plasma5Support’s executable engine, with python3: the script copies the application icon and the twelve layout icons into the user’s ~/.local/share/icons/hicolor and refreshes the cache with xdg-icon-resource from xdg-utils. The port installs the same SVGs in the system hicolor theme as well, under the names the script gives them, so the icons resolve before that copy and for a user whose copy fails.
The QML imports org.kde.kwin from kwin, org.kde.plasma.core and org.kde.plasma.components from libplasma, org.kde.taskmanager from plasma-workspace and org.kde.plasma.plasma5support from plasma5support; none is checked at build time, and a missing one fails only when KWin loads the script.