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

358.9. kcm-kdos-boxes-1.0.0

System Settings page for boxes — per-box permissions, grants, colour and lifecycle over kdos-box

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

About

Boxes is the System Settings page for KDOS’s boxes, the containers boxed applications run in. It is under Security & Privacy → Application Permissions. It lists every box kdos-box list reports, under its application’s name and icon, and for one box shows:

While a box runs, the page says which boundary held for it — confined, tagged or not confined — and why, in the words kdos-appbox recorded at its last launch. A running distrobox with no profile and no record, such as the one kdos-fetch-app makes and distrobox enter starts, reads as not confined, because a distrobox shares the home and the session’s runtime directory, display and bus; the page knows it by the container’s manager label in kdos-box list --json. kdos-box’s own boxes carry that label too, since distrobox create makes them, but each has a profile, so one with no record stays unknown.

The page writes no file of its own about a box and never calls podman. It reads the profile from ~/.config/kdos/boxes/<box>.conf, shows beside each control what kdos-box profile <box> says enforces that key and every ! line about a value it cannot deliver, and applies a change with kdos-box profile <box> key=value for the keys that changed. Lifecycle buttons run kdos-box and kdos-appbox the same way, as the user and without root. Opening it as systemsettings kcm_kdos_boxes --args <box> opens that box, which is how Discover’s “Runs in a box” badge links to it.

Why it is in KDOS

The comment above the 5 ports from kcm-kdos-system to kcm-kdos-health in script/phases/50_desktop/packages.txt:

System Settings pages: the A/B slots, boxes, the firewall's named services, the KDOS look and Phosphor mode, and the Health page.

Sources

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

Dependencies

Depends on: extra-cmake-modules, qt6-qtbase, qt6-qtdeclarative, kcoreaddons, ki18n, kconfig, kcolorscheme, kservice, kitemmodels, kcmutils, kirigami, systemsettings, kdos-appbox.

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 kcm-kdos-boxes'

What kpkg does

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

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/kcm-kdos-boxes
SRC=$SRC_ROOT/kcm-kdos-boxes-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 \
	-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
	-D BUILD_TESTING=OFF \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

The switches, and why each is set:

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/kcm-kdos-boxes, 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 kcm-kdos-boxes-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/kcm-kdos-boxes, and runs the triggers its paths call for.

Other files in the port directory, read by build.sh: CMakeLists.txt, accentmodel.cpp, accentmodel.h, boxesmodule.cpp, boxesmodule.h, boxlistmodel.cpp, boxlistmodel.h, boxprofile.cpp, boxprofile.h, boxtool.cpp, boxtool.h, confinement.cpp, confinement.h, kcm_kdos_boxes.json, plugin.cpp, tests/, ui/.

Notes

A namespace, a volume or a podman limit cannot change on a live container, so a change to network, home folder, what it writes, devices, graphics card, the init process or a limit, on a box that has a container, is written and takes effect only when the box is created again. The page remembers the changes made on it in $XDG_STATE_HOME/kcm_kdos_boxesstaterc, reads those made with kdos-box profile from the report’s ! line naming the keys that differ, and shows a Recreate banner until the box has been made again. For a labelled container (created = matches or differs in the report) the report is authoritative, and a remembered key it does not name is forgotten, whichever write set it back; an unrecorded container keeps the page’s memory. Recreate stops, removes and creates the box with kdos-box. Only a pack box writes outside its container; any other box keeps its writes inside it, so recreating or removing one deletes them, and the confirmation says so.

The list is read from kdos-box list --json alone. The table kdos-box list prints is for a person, and its widths and its two-word STATE make it no format to parse.

The swatches are read from /usr/share/color-schemes/KDOS<Accent>.colors and KDOSBox.colors through KColorScheme: the Header set’s background, text and focus decoration, or the [WM] background, foreground and blend of a scheme with no Header set. Most KDOS title bars are near-black, so the text sample and the accent stripe are what tell the swatches apart. An accent whose scheme is not installed cannot be chosen, and Neutral, the default, can always be.

The confirmation dialogs are parented to the window’s overlay. Declared in a SimpleKCM, a Kirigami dialog finds no applicationWindow() in a KCM’s QML context, stays in the scrolled content and is centred there, out of view behind its own modal dim.

The QML and the C++ share the translation domain kcm_kdos_boxes, the plugin id, because KQuickConfigModule::mainUi() sets the QML engine’s domain to the plugin id. X-DocPath is kdos/04-programs/kdos-settings.html#boxes, a path under help:/: System Settings’ Help button puts help:/ in front of it, and KIO’s help: worker finds the page through /usr/share/doc/HTML/en/kdos, the link kdos-doc installs (see Help). The test asserts the kdos/ form.