Skip to the text
KDOS
Menu

The kdos command

kdos is the command-line front door to a KDOS machine. It answers what the machine is and what is wrong with it, sets the accent and Phosphor mode, lays out the panels, manages applications and backups, keeps a live session across reboots, updates the system, and gives scripts a handle on the desktop. The same binary also answers to eleven other names, among them the service supervisor ksvc, the boot-slot tool kdos-bootctl and the screenshot tool kdos-shot, and this chapter is the reference for all of them.

It is written for anyone working at a KDOS prompt, whether diagnosing a fault, changing the look of the desktop or scripting it. If you are new to KDOS, run kdos help, then kdos status and kdos doctor: those three say what the machine is, what is running and what is wrong, and everything else here is something you reach for with a specific job in mind. Terms such as box, pack, accent, desk and binhost are defined in the glossary. The user-facing tour of the same commands, arranged by task, is Administration.

Synopsis

kdos <subcommand> [arguments...]
kdos help [--pager | --keys]
kdos version

kdos with no subcommand is kdos help. -h and --help are accepted as spellings of help, and --version and -V of version. kdos <subcommand> -h and kdos <subcommand> --help print that subcommand’s usage on standard output and exit 0, for every subcommand: asking for help is not a usage error, so a script can test a subcommand’s presence by its status. Only the first argument after the subcommand is looked at, so --help further along the line is an ordinary argument. An unknown subcommand, with or without --help, prints kdos: unknown command '<name>' — try: kdos help on standard error and exits 1. Colour is used only when standard output is a terminal, so output piped into another program is plain text.

Most subcommands follow one exit-status convention, so a script can test the answer without parsing text:

Exit Means
0 Nothing to report: clean, up to date, done
1 Something was found (a warning, a stale process, a vulnerable package), or the action failed
2 The command was used wrongly, or could not run at all; never for -h or --help, which exit 0
127 The program this subcommand hands over to is not installed

Where a subcommand differs, its section says so.

Every subcommand that changes the desktop does it through the program that owns the setting: Plasma’s own command-line tools and kwriteconfig6 for configuration, KWin, plasmashell, KRunner and kglobalaccel over the session bus, and kdos-settingsd, kdos-sysupdated and kdos-powerd for what is root’s. A command that wrote those files itself would be a second way in with its own rules, and the settings page that shows the value would show something else.

Finding a subcommand

Subcommand Answers
app Install, launch, remove, export and import containerised applications
appid Does every open window have the launcher it claims?
backup One restic snapshot, as ~/.config/kdos/backup.conf says
checklist The first-run checklist, which ticks itself
clone Copy this boot medium onto another, verified by read-back
cve Offline vulnerability tracking against a vendored database
desk Lay the panels out as one of the three desks, or put them back
doctor Check the machine for the faults KDOS is known to have
explain Browse the recorded reasons behind the system’s design
firmware Install the vendor firmware this machine’s hardware asks for
help The command list and the global shortcuts
hey Ask KWin about windows, screens and boxes
hostname Print or set the machine’s name
image Make, verify and write signed slot images
in-vm Is this a virtual machine?
keymap Print or set the console keymap
locale Print or set the locale
march Measure whether a processor tuning flag is worth keeping
menu Open KRunner on a named route
notify Raise a notification
oracle One recorded lesson, picked for today
panel Hide the panel and bring it back
persist Keep a live session’s writes across a reboot
phosphor Phosphor mode: the CRT pass, its motion and its accent
places Dolphin’s Places, and the way to add to them
privacy Who has the microphone, the camera and the screen
rebuild Rebuild KDOS from the sources on this machine, offline
remind Schedule a notification for later
restarts Which running processes still use code an upgrade replaced
sandbox Run a native program under a Landlock profile
settings System Settings, at a page
share Send a file to another machine over one code word
speech Transcribe, read aloud, and manage the models
status What this machine is and what it is running
theme Set and audit the accent
thumb A file’s thumbnail in the shared cache
tiling Auto-tiling on or off
timezone Print or set the time zone
toggle Stay-awake, night light, do-not-disturb and reduced motion
trash The desktop’s trash, from a prompt
update Check for and apply system updates across the A/B slots
verify Check a file against its checksum files and its KDOS signature
version Release and build, kernel, C library, userland, session and accent; also --version and -V
why What provides a path or a port, and why it is that way

The other names on the binary (the service supervisor, the boot-slot tool, the screenshot tool and the rest) are covered in The other names on this binary.

Tab completion

Press Tab after kdos in bash and it offers the 44 subcommands in the table above. The completion file is /usr/share/bash-completion/completions/kdos. After the first word it completes what each subcommand takes:

The same file completes kdos-shot’s five modes and gives kdos-share file names plus its --clipboard flag. bash-completion loads a completion file on demand, by the name of the command being completed, and there is no file named kdos-shot or kdos-share: those two complete only after kdos has been completed once in the same shell.

The other KDOS commands have a file each beside it, every one completing the verbs and options of the program’s own usage text and then the names a verb takes:

File Completes
ksvc ksvc and service: the verbs (list, status, start, stop, restart, enable, disable, help) and --user, plus supervise, stop-supervised and check under the name ksvc; then the service names, /etc/init.d/NN_<name>.sh without the number and the .sh (/etc/kdos/user-services after --user); after supervise, its options, a name, then a command
kpkg The commands and the options before them; installed packages after remove, info, check, facets and needs; ports (the kpkgbuild directories under /ports, where the trees are, and the installed packages) after install, fetch, meta, verify and binhost; directories after --root, index, verify-index and store gc; files after sign, verify-pkg, delta and apply-delta
kdos-box The verbs; box names (the profiles under ~/.config/kdos/boxes and the containers podman ps --all lists, which is where kdos-box list reads them) after the verbs that take one; the profile keys as key= after create <name> and profile <name>; --window, --force and --purge, --dry-run and --session-end where those verbs take them
kdos-appbox The commands and --box, --launcher, --verbose; the commands kdos-appbox apps lists after run; store ids and groups from kdos-appbox catalogue after install, export and import, the installed ones after uninstall; files after open and throwaway; box names after --box
kdos-bootctl The commands; a and b after select, set-slot, try, unfill and deploy <root>; short, pretty and off after list --json=; the accents after palette and theme; phosphor and modern after splash
kinstall Its options; probe, plan, apps and look after --dump, the accents after --theme, files after --config and --save

bash-completion ships its own service completion, written for SysV init: it expects the name before the verb and skips every *.sh script, so it would offer nothing useful on KDOS. The startup file /usr/share/bash-completion/startup/ksvc.bash, which bash-completion runs after loading its own completions, therefore sources the ksvc file, and service gets KDOS’s verbs and names. The other files load on demand by name.

Keyboard shortcuts

Keys reach these commands through kglobalaccel, KDE’s global-shortcut service, like every other shortcut on the desktop. KDOS adds two of its own:

Key Runs Declared in
Meta+Shift+T kdos tiling toggle /usr/share/kglobalaccel/org.kdos.tiling.desktop
Meta+Ctrl+Shift+N kdos toggle night-light /usr/share/kglobalaccel/org.kdos.nightlight.desktop

The screenshot keys belong to Spectacle, and the media keys to Plasma’s media controls, which reach mpd through kdos-mpctl mpris. Every chord, and how to change it, is in KWin.


Orientation

kdos help

kdos help            # print the sheet
kdos help --pager    # the same, through $PAGER (default less)
kdos help --keys     # the global shortcuts alone

The sheet has three blocks:

--keys prints the KEYS block alone. Nothing in it needs a session: the sheet is most useful where none is running, at a console or over ssh.

--pager renders the sheet into memory and feeds it to $PAGER on standard input, adding -R only when the pager is less, because another pager may not accept the flag. If the pager is not installed or fails, the sheet is printed to standard output instead. The KDOS Help menu entry runs kdos help --pager in a terminal.

Manual pages and the book

This book is on every image, as HTML under /usr/share/doc/kdos. The Help Center lists it first where KHelpCenter is installed (it comes with the kde-system group, not with the base image). kdos-doc opens it at a page:

kdos-doc                                    # the title page
kdos-doc 04-programs/kdos-command           # a chapter
kdos-doc 04-programs/kdos-command#kdos-theme

A page is named as the book’s own links name it, with or without .md or .html. Where it opens depends on where you are:

Where Opens in
A graphical session (WAYLAND_DISPLAY or DISPLAY set) KHelpCenter where it is installed; otherwise, as on the base image, the desktop’s browser through xdg-open
No graphical session, with standard input and output both a terminal (a text console, ssh) lynx, or w3m where lynx is absent, at the anchor’s heading
Anything else, or no viewer installed Nothing: the page’s file path is printed, so kdos-doc page \| cat at a console, and a script, get the path

The name may hold only letters, digits and ._-/, in the page and the anchor alike, and no .., so it can only name a page under the book’s directory. It exits 1 when the page is not in the book, 2 on bad usage, 0 when it printed the path, and otherwise with the viewer’s status.

man 7 kdos says where the book is and lists its chapters. Every kdos-* command has a manual page, man kdos-appbox for example, and so do the commands of ours without the prefix: kpkg and its four other names, ksvc and service (section 8), kinstall and xdg-terminal-exec. apropos kdos lists the kdos-* pages.

The manual pages are generated from this book, so a page and the book cannot disagree:

The kdos-doc port writes all of it from docs/kdos at build time; see Developing.

The second book, KDOS from Scratch, which builds KDOS phase by phase and package by package, is not on the image: sudo kdos update install kdos-kfs installs it, as /usr/share/doc/kfs/index.html and the whole of it as /usr/share/doc/kfs/kfs.pdf, and the Help Center then lists it second. The kdos-kfs port writes both from docs/kfs and the recipes.

kdos status

kdos status
kdos status --bar            # one line: running boxes and exported applications

Prints what this machine is and what it is running:

Line From
KDOS Linux <release> The running kernel
Accent The accent in force
Packages Entries in /var/lib/kpkg/db
Exported apps .desktop files in ~/.local/share/applications
Alien apps Non-comment lines in /usr/share/kdos/alien-apps, the table baked at build time
Session elogind’s answer for this process: Plasma <version> (Wayland) for a Plasma session, with a note when it is not the active one on its seat; the session type (tty on tty2); or none (no elogind session) for an ssh login or a shell outside any login
BOXES podman ps -a: every container, its status and image
EXPORTED APPS The exported entries by name

The alien application count reads the baked table rather than asking the container engine, so it answers on a machine where no box has ever been created.

--bar prints N box · M app: the number of running containers and of exported entries.

kdos version

kdos version
kdos --version
kdos -V
KDOS — Kool Desktop Operating System
  release  0.2
  kernel   7.2.11
  libc     musl
  userland GNU
  session  Plasma 6.8.2 (Wayland)
  accent   bone

The release is VERSION in /etc/kdos-release, the form the boot menu, the splash, the installer, the greeter and What’s New give: 0.2 on a release build and 0.2+<BUILD_ID> on any other, so a -dirty development image and the release it is not print different lines. A root with no record gives /etc/os-release’s VERSION_ID, with +<BUILD_ID> when the image was stamped with its commit; the line is left out when neither names a release. KDOS_UPDATE_SYSROOT stands in for the root, as it does for kdos update notes. The session line is the same answer kdos status gives. The figures above are an example of the shape.

kdos doctor

kdos doctor [--json]
kdos doctor --cve [...]      # hands the rest of the line to kdos cve

Checks the faults that are known to occur on KDOS rather than running a generic health sweep. Each check reports one of three levels:

Section Checks
Kernel The Landlock ABI level (and whether Landlock is compiled out or merely disabled), and whether the initramfs carries microcode for this processor’s vendor
Hardware The wireless regulatory database, its signature and the regulatory domain; SOF audio firmware and topologies; NVIDIA GSP firmware when nouveau is bound, naming sudo kdos firmware sync when it is absent; whether the calling user can open each attached serial, camera and instrument device (/dev/ttyUSB*, /dev/ttyACM*, /dev/video*, /dev/usbtmc*), naming the owning group of any it cannot; and, on a live session, whether the boot medium is reachable at /mnt/iso
Boxes Whether erofs is available to the kernel, whether kdos-packd answers and by which mount route, whether the user is uid 1000 (packs are built for it), whether the home directory’s filesystem can hold a container’s writable layer, whether every mounted pack still has a file behind it; then the box plumbing (kdos-boxsock, kdos-boxinit, xdg-dbus-proxy) and each box’s confinement as its last launch recorded it
Boot Whether rcS finished, whether this boot is confirmed or still a trial nobody blessed, and whether SDDM has been restarting (after three exits within a minute, kdos-dm gives tty1 to a console password prompt instead, and the warning in text mode is followed by the last ten lines of /var/log/sddm.log)
Session Whether the Wayland socket exists (not only whether WAYLAND_DISPLAY is set), XDG_RUNTIME_DIR, turnstile and the supervised session bus, whether DBUS_SESSION_BUS_ADDRESS names its socket $XDG_RUNTIME_DIR/bus (only the unix:path= value is compared, so the ,guid=… dbus-daemon appends for the services it activates, KRunner among them, is the same bus), elogind and whether this session is the active one on its seat, and whether kwin_wayland, plasmashell and the polkit agent are running and the KDE portal, the session manager (ksmserver) and the secret service own their bus names; a wallet switched off (kwalletrc [Wallet] Enabled=false, as the live medium ships it) makes the secret-service line a skip
Services kdos-powerd’s socket and io.kdos.Power1, kdos-settingsd, udisks2, tlp-pd when it is installed, kdos-sysupdated and the last update check’s problem, kdos-energyd (a skip on a machine with no RAPL energy counter, most virtual machines among them), kdos-oomd and the protected names it lists that are not running
Containers That the mount-namespace root is /, the /etc/subuid and /etc/subgid entries rootless containers need, and, when podman is installed, that podman info opens this account’s store: ok with the store’s path, or a warning with podman’s own first line of complaint; run as root, a warning instead
Desktop The accent and its global theme org.kdos.<accent>.desktop, Xwayland (its socket when DISPLAY is set; otherwise the binary, and /tmp/.X11-unix root-owned and mode 1777, without which KWin cannot start it), the lock screen’s PAM stack and setuid unix_chkpwd, the setuid helpers (below), fcitx5 when installed, and ~/.local/bin on PATH
Security Whether the kdos password is still the shipped default, and, when it is, whether sshd is enabled (/etc/init.d/70_sshd.sh executable and no /etc/service.disabled/sshd), which turns the warning into one that anyone who can reach the machine can log in. The section appears only when /etc/shadow is readable, so an ordinary user gets no section rather than a check that pretends it looked

The session check looks for the socket because a session that died leaves WAYLAND_DISPLAY set in every shell that inherited it. A doctor that reported that as fine would send you looking everywhere but at the dead compositor. A name on a bus is asked, not a process listed, wherever there is a name: a daemon that is running and owns nothing answers nobody.

On a live session the box check is a skip, [skip] $HOME is on overlayfs (a live session): a box's writes end with the session, and an installed system keeps them, in --json too. That is the live medium working as made, so it does not make doctor exit 1, and the Health page shows it as a grey skipped row. Nothing in the session keeps a pack box’s writes: kdos-packd puts its writable layer in the runtime directory’s memory, so only an installed system keeps them. kdos persist keeps the podman storage of store and development boxes, not a pack box’s layer.

Losing a setuid bit is silent, and each of these fails differently:

Helper Without its bit
unix_chkpwd Every password at the lock screen is refused, and the session locks you out
newuidmap, newgidmap The container engine exits 125 and no box starts
dbus-daemon-launch-helper (also needs group messagebus) No D-Bus system service is ever activated: the Wi-Fi supplicant, fingerprints and firmware updates among them
Exit Means
0 No warnings
1 At least one warning
2 Unknown option

The exit status is the same in text and JSON mode. --json prints {"checks": [{"section", "level", "message"}, …], "warnings": N}, one record per line of the text report.

--cve hands the rest of the arguments to kdos cve, and the exit status is kdos cve’s. The vulnerability report is a table with its own exit code and database date, and folding it into doctor’s lines would flatten “17 packages are behind a recorded fix” into one warning.


The desktop

kdos theme

kdos theme                    # print the accent in force (also: show, current)
kdos theme <name>             # phosphor amber ice bone norton borland perfect paper
kdos theme list | next | prev
kdos theme style <file>
kdos theme --audit [accent]   # also: audit
kdos theme --account <accent>
kdos theme --from-plasma [--account] <accent>

KDOS has eight accents, compiled into libkcolor. bone is the default: a machine with no accent file uses it. list marks the one in force with * and prints each accent’s theme name beside it; next and prev step through the table and wrap around. The user-facing guide is Theming.

What setting an accent does

Everything Plasma wears was generated from libkcolor’s table when the image was built: a colour scheme, a Konsole profile, a qt5ct palette, a wallpaper and a global theme, org.kdos.<accent>.desktop, per accent. A switch is therefore a choice between files that exist. What is generated here is only what no package can ship: the configuration of the terminal programs in your home. The steps, in this order:

  1. The accent, written first and atomically to ~/.config/kdos/accent. kded-kdos compares the Global Theme page against exactly this file, and a half-written word would read as a foreign scheme.
  2. The global theme, applied with plasma-apply-lookandfeel -a org.kdos.<accent>.desktop -k: colours, Plasma style, icons, cursor, window decoration, splash and fonts in one call. -k keeps the automatic light and dark switch, and no layout reset is asked for, so the panels are not touched. The light and dark pairing is moved with it: a dark accent pairs with Paper, but only while the dark half is still a KDOS theme.
  3. The wallpaper of the desktop, over the session bus, because a global theme does not change a running desktop’s picture, and of the lock screen, in ~/.config/kscreenlockerrc, because no global theme carries that one at all. Only a desktop showing a KDOS wallpaper, or the theme’s default, is moved, and only a lock screen whose picture is a KDOS one or none.
  4. Konsole: the profile a new tab opens in, and every open tab whose profile is one of KDOS’s. A tab on a profile you made keeps it. QMLKonsole’s colour scheme (colorScheme in ~/.config/qmlkonsolerc) moves to the accent’s KDOS-<Title> scheme while it names a KDOS one.
  5. The terminal programs: bat, micro, helix, neovim, delta, newsboat, aerc, fzf, tmux, btop, mc, yazi, starship and LS_COLORS; a running tmux server re-reads its configuration.
  6. qt5ct, for Qt 5 applications.
  7. Phosphor mode’s tint, when the effect is loaded: KWin re-reads it, and the screen degausses once.
  8. The machine’s half: kdos-power accent <name> asks kdos-powerd to recolour the boot menu, the splash, the text console and the login screen, which are root’s files. The daemon accepts the request from root and wheel, and from the active session where polkit grants it, which the shipped policy does. When it is not running or refuses, or the boot menu cannot be written (the live medium), the last line says what stayed as it was, and the accent is still applied everywhere else.

Every step leaves alone what you chose yourself: a wallpaper, a Konsole profile, a dark-theme pairing or a qt5ct palette is moved only while it still names a KDOS file. An accent switch that took your own wallpaper with it would be a switch nobody could use twice.

Outside a Plasma session (at a console, over ssh, or the installer’s --account run into a new home) there is no running desktop to change:

The command prints <accent> (<theme name>) and, from step 8, a line when the machine’s half was not reached. It exits 0 when the session wears the accent, even when the machine’s half was refused, and 1 when a session step failed, with the reason as the last line.

Two options run part of the sequence, for the programs that call kdos theme themselves:

Style files

kdos theme style <file> applies a shareable look: an accent and Phosphor mode’s tuning, in one flat key = value file.

accent = amber
crt = 55
crt_scanlines = 60
crt_curve = 30
crt_fullscreen = true
Key Goes to
accent The accent, applied as kdos theme <name> applies it; without one, the accent in force is kept
crt, crt_scanlines, crt_curve kwinrc [Effect-kdos_crt] Strength, Scanlines and Curve, numbers
crt_fullscreen kwinrc [Effect-kdos_crt] Fullscreen, true or false
Anything else Ignored, with a warning naming the key

The tuning is written whether Phosphor mode is on or not, and the effect re-reads it at once when it is loaded. A key that silently did nothing would be a look that differs on the second machine with nobody told.

Auditing

--audit checks three things and writes nothing outside a temporary directory:

Give it an accent (kdos theme --audit amber) to see what would change if you switched to that accent, before you switch.

Exit Means
0 Everything matches
1 Something has drifted
2 The audit could not run

kdos phosphor

kdos phosphor on [--preset subtle|retro] [--terminus | --no-terminus]
kdos phosphor off
kdos phosphor status [--json]
kdos phosphor preset subtle|retro
kdos phosphor terminus on|off
kdos phosphor fullscreen on|off
kdos phosphor collapse | unfold | degauss

The one switch for Phosphor mode. It turns on KWin’s kdos_crt effect, the CRT pass over the whole screen, and the three motion effects that replace KWin’s own login and log-out animations; puts the phosphor accent in place of bone or paper, the two accents that do not read as a CRT; with the Terminus option, sets the fixed font and a Terminus Konsole profile; and sets the boot splash’s motion through kdos-powerd. It is off by default for every new user, and no key is bound to it. What the effect draws is in KWin, and what it costs in Theming.

Off puts back what on found, key for key. Before it changes anything, on writes ~/.config/kdos/phosphor: the raw value of every key it is about to change as your own file had it, under [Saved], or the key’s name under [Unset] when the file had none. off writes each back through kwriteconfig6, so a file KConfig last wrote comes back byte for byte. When you picked another accent while the mode was on, off keeps your accent and drops only the pairing’s records, and the Konsole keys follow the accent in force.

Software rendering is refused before anything is written. The effect is unsupported on a software renderer, where a full-screen pass per frame would be the desktop’s whole budget, so KWin is asked first, and a refusal of on leaves no state file and no key behind. The option verbs (preset, terminus, fullscreen) refuse nothing: each records its option, which takes effect at once while the mode is on and at the next on while it is off.

Verb Does
on Turns the mode on with the preset (default subtle) and the Terminus option as asked; on a mode already on, only the options move. Prints phosphor mode on (<preset>)
off Puts every key back and prints phosphor mode off, or phosphor mode is already off
status phosphor, supported (with the reason when not), preset with its strength, scanlines and curve, fullscreen, terminus, accent (and the one before the mode), and the effect’s phase
preset subtle (strength 55, no scanlines, no curve) or retro (strength 55, scanlines 60, curve 30); a preset whose values were edited by hand reports as custom. Applied at once while the mode is on, recorded for the next on while it is off
terminus The Terminus option alone: the font changes at once while the mode is on, and is recorded for the next on while it is off
fullscreen Whether a fullscreen window is drawn through the pass (drawn) or exempt from it; recorded in kwinrc whether the mode is on or off
collapse, unfold, degauss Plays one of the effect’s motions now, through io.kdos.Crt1 at /io/kdos/Crt1 on KWin

status --json prints one object: state, on, supported, reason (null when supported), refusal ("session" or "gpu", the refusals of exit statuses 2 and 3, or null), preset, strength, scanlines, curve, fullscreen, terminus, accent, previous_accent, loaded (whether each of kdos_crt, kdos_unfold, kdos_login and kdos_quit is loaded) and phase. The Look settings page and the welcome tour read it; reason is the command’s own sentence, and refusal is for a front end that says it in its own words.

Exit Means
0 Done
1 A key could not be written or put back, or the state file could not be written
2 Bad usage, or no Plasma session to ask (phosphor mode needs a running Plasma session)
3 The session renders in software (phosphor mode needs GPU rendering (this session renders in software))
4 A motion was asked for while the mode is off

When kdos-powerd does not answer, the mode still turns on and a line says boot splash unchanged (kdos-powerd did not answer).

kdos desk

kdos desk                          # kdos, dock or tiling
kdos desk status --json
kdos desk kdos | dock | tiling     # lay the panels out again
kdos desk undo                     # put the last panels back

A desk is a Plasma layout template, org.kdos.desk.<name>, applied by plasmashell’s own scripting: every panel goes and the template lays the new ones out. The three desks are described in Plasma’s shell. Because a desk throws away whatever you arranged, the panels file is copied to two places first: the undo set in ~/.config/kdos/desk-undo, with plasmashellrc, the auto-tiling key and the desk it replaced, which kdos desk undo puts back whole; and a dated copy under ~/.local/share/kdos/desk-backup/<UTC time>/, which nothing removes. The backup’s path is the last line printed. The desk’s name is written to ~/.config/kdosrc as [Desk] Layout.

A desk is the whole arrangement: the tiling desk turns auto-tiling on and the other two turn it off. Outside a session the name is recorded and the command prints desk <name> is laid out at the next login. undo with nothing recorded prints nothing to undo, and after a restore the undo set is emptied.

status --json prints {"desk", "panels_edited", "undo"}: the desk in force, whether the panels were changed by hand since it was laid out, and the undo set’s path or null. panels_edited is true when the panels differ from the digest in [Desk] LaidOutPanels; it is always false outside a session. The digest covers each panel, where it sits, its applets in their order, and the settings every desk writes into them: Start’s icon and label, the task manager’s pinned launchers and each meter’s face. Each of those is a value its applet writes back unchanged when it loads, which is why the digest can be taken straight after the template runs, before the applets have loaded. A desk that has lost those settings (a Start with no icon, a task manager with no launchers, a meter with no face) reads as edited, so kdos desk <name> is the repair it points to. undo puts back the digest of the desk it restores. The welcome tour asks it before offering a desk.

kdos tiling

kdos tiling [status] [--json]
kdos tiling on | off | toggle [--only <desktop>[,<desktop>...]]

Auto-tiling is Krohnkite, a KWin script, switched by its kwinrc [Plugins] krohnkiteEnabled key and KWin’s reconfigure, which loads or unloads scripts to match. It is off by default. Meta+Shift+T runs kdos tiling toggle. toggle prints the new state; status --json prints {"tiling", "loaded"}, the key and whether KWin has the script loaded. Outside a session the key is written for the next login and the command exits 0.

--only names the virtual desktops to tile, by the names KWin gives them, and leaves the rest floating. Krohnkite tiles every desktop except those in its ignoreVDesktop key, so the list written there is every other desktop’s name, which is why --only needs a running session to read the names from.

kdos toggle

kdos toggle                  # list them and their state
kdos toggle <name>           # flip it
kdos toggle <name> on|off    # set it

Four switches, each the Plasma surface’s own state, so the applet that shows it shows what this command set, and a click there undoes it here:

Name Is
stay-awake An inhibition of sleep and of the screen locker, held by a process of ours for as long as the switch is on; the battery applet lists it as blocking. PowerDevil drops an inhibition the moment its holder leaves the bus, so the holder is the state, and its pid file says where it is
night-light kwinrc [NightColor] Active, the key System Settings’ Night Light page writes and KWin watches. On also writes Mode=Constant, so the screen warms at once and stays warm all day, in place of the page’s schedule; off writes Active=false. It reads as on while KWin reports Night Light enabled and not suspended; on lifts a suspension made with KWin’s own Suspend/Resume Night Light action, and fails, putting the suspension back, when another program is holding Night Light off. Meta+Ctrl+Shift+N runs kdos toggle night-light
dnd plasmanotifyrc [DoNotDisturb] Until, the key the notification applet’s own switch writes, set far ahead; deleted to switch it off
reduced-motion kdeglobals [KDE] AnimationDurationFactor=0 in your own file, which stops every animation KWin, Plasma and Phosphor mode draw; off deletes the key, so the shipped factor applies again

The list prints each name, on or off, and what it is. An unknown name, or a second argument other than on or off, exits 2. Typed at a prompt, the new state is printed (night-light on). Run from a key binding or a menu, where standard output is not a terminal, it is shown as a notification instead, because a silent keystroke cannot be told from a broken one. The notification is titled with the switch’s name, Stay Awake, Night Light, Do Not Disturb or Reduced Motion, then on or off (Night Light on), and its body says what the new state does: the screen is warmed now and all day for Night Light on, the screen is back to its normal colours for off, and the like for the other three. It is raised through kb_notify(), so it stays in the history like the others below.

kdos notify

kdos notify <summary> [body]
kdos notify --time | --battery | --dnd

With a summary, this raises a notification, which is useful at the end of a long job:

make && kdos notify "the build finished"

It is a Notify call on the session bus, sent and answered, so a command typed at a prompt waits the moment it takes and says so when no notification server answered. It carries the sound-name hint message-new-instant, so Plasma plays the sound theme’s new-message voice with it, unless Do Not Disturb is on or the Notifications page has sounds off. A program that must never wait (a terminal’s OSC 9 notification, a screenshot’s) uses the same call fire-and-forget through kb_notify() in libkbase, with no sound.

Both carry the hint x-kde-appname=kdos, which names /usr/share/knotifications6/kdos.notifyrc, installed by kdos-tools. Plasma then draws the notification with the KDOS mark and a Configure button, keeps it in the history after the popup closes, and lists the sender as KDOS Tools on System Settings’ Notifications page, where its popups, history and Do Not Disturb behaviour are set. A notification with no notifyrc behind it would be filed under “other applications”, which Plasma keeps out of the history, so a reminder that fired while nobody looked would be lost. The same hint is sent by kdos remind, the toggles, kdos verify --notify, kdos speech, kdos-shot, kdos-share, every kdos-notice notice and a failed verb started from KRunner.

--time and --battery compute their text, which a shortcut cannot do: a shortcut runs a fixed command.

--dnd is kdos toggle dnd. The notification centre’s own verbs (dismissing, raising, counting and listing) belong to Plasma’s notification applet, and asking for one is a usage error that says so.

kdos remind

kdos remind in 20m tea
kdos remind at 15:30 call back
kdos remind tomorrow 9 stand-up
kdos remind ls | clear
kdos remind fire ID
kdos remind --ask            # a dialog asks for the whole line

Schedules a notification for a later time. Everything after the time is the text; a -- before it is optional.

Form Means
in N<s\|m\|h\|d> That long from now, at most 300 days
at HH[:MM] The next time the clock reads that; a time already past today means tomorrow
tomorrow HH[:MM] That time tomorrow

in is capped because a timer pattern carries a month and a day but no year, so past a year the same pattern would mean a different date. Any other form is refused rather than guessed at.

Each reminder is a row in your personal timer table, ~/.config/kdos/timers.d/remind-<id>.timer (see Configuration), so it survives a logout and comes back with your user services. snooze does the waiting.

Your user services read the timer table when they start, so a reminder set now would wait for the next start. kdos remind therefore starts its own snooze as well, and the next start runs another from the same file. Only one delivers, because kdos remind fire removes the file before it returns and the other then finds nothing: the file is the reminder. With no session bus when the time comes, nothing is delivered and the file stays. A delivered reminder is filed under KDOS Tools (above), so one that fired while you were away waits in the notification history.

The text is a comment line in the file, because both timer parsers split a row into words with no quoting, so "make tea" would arrive as two broken words; ls reads the text back from there, and prints each reminder’s id, the time it is due (due Wed 18 Nov 04:00, the first moment at or after the file’s modification time that its row names) and its text, soonest first. A row kdos remind did not write is listed by the time its file was written instead, as set <time>, after every row with a due time. snooze -t counts from the file’s modification time, the moment the reminder was set, with a day of slack, so a reminder due while the machine was off fires when it comes back.

clear removes every reminder file. An armed snooze is left running; when it wakes it finds no file and delivers nothing, by the same test fire applies.

--ask opens a one-line kdialog input and takes what you type (in 20m tea) as the whole argument, because a shortcut runs one command with no shell.

ls (when there is at least one reminder) and clear answer with a notification when standard output is not a terminal, because the shortcuts that run them have nowhere to print; the ls notification shows the four that are due soonest, in the same order. With no reminders, ls prints no reminders to standard output wherever it goes.

kdos panel

kdos panel toggle

Hides the first panel, or brings it back, through plasmashell’s own scripting, so the panel’s settings dialog shows the same state afterwards. When plasmashell does not answer it says so and exits 1. Any other argument exits 2.

kdos menu

kdos menu summon <route>     # KRunner on a named place
kdos menu toggle [<route>]   # the same, or KRunner's own toggle with no route

A route is a name for a place in the system, such as setup.network, defined in /etc/kdos/menu.conf and your own ~/.config/kdos/menu.conf; see Configuration. A script holds a route rather than a chord, because chords can be rebound and menu rows move.

Both verbs open KRunner showing the KDOS runner alone with route:<route> as its query, so the one row it answers is the place and Enter goes there. toggle with no route is KRunner’s own show-or-hide. When KRunner does not answer the command says so and exits 1; a missing or unknown verb exits 2.

kdos settings

kdos settings              # System Settings
kdos settings network      # straight to a page
kdos settings kcm_kscreen  # or a module by its id

Replaces itself with systemsettings, given the module the word names. The words are a fixed map:

Words Module
appearance kcm_lookandfeel
look, accent kcm_kdos_look
colors, fonts kcm_colors, kcm_fonts
network, wifi kcm_networkmanagement
bluetooth kcm_bluetooth
sound, audio kcm_pulseaudio
display, screens kcm_kscreen
nightlight kcm_nightlight
power kcm_powerdevilprofilesconfig
keyboard kcm_keyboard
shortcuts, keys kcm_keys
mouse, touchpad kcm_mouse, kcm_touchpad
time, date kcm_clock
region kcm_regionandlang
users kcm_users
printers kcm_printer_manager
notifications kcm_notifications
accessibility kcm_access
firewall kcm_kdos_firewall
boxes kcm_kdos_boxes
health, about kcm_kdos_health
system, updates kcm_kdos_system
backup kcm_kup
autostart kcm_autostart
defaults kcm_componentchooser

A word with no row opens System Settings at its start, which is a better answer to a typo than an error; a word that is itself a module id (kcm_ and lower-case letters, digits and _) is passed through. KDOS’s own pages are described in KDOS’s settings pages. When systemsettings is not installed the command says so and exits 127.

kdos places

kdos places                  # the places, one per line
kdos places add DIR [NAME]   # keep one

Prints Dolphin’s Places: $XDG_DATA_HOME/user-places.xbel, which Dolphin’s Places panel, every KDE file dialog and Kickoff’s Places tab show. Each line is the name and the path.

add keeps a folder there, inserting a bookmark before the file’s closing tag in the shape KDE writes its own and touching nothing else in the file. The name defaults to the folder’s own name. The path is made absolute before it is stored, so kdos places add . means the directory you are in. A folder that is already a place is reported and not added twice. A home with no user-places.xbel yet is refused rather than given one: KIO lays out the default places (Home, Downloads, Trash and the rest) only into a file that does not exist, so a file created here holding one folder would be a Places panel without them for good. F2 in mc runs this command, because mc cannot drag a folder into Dolphin’s panel.

kdos thumb

kdos thumb <file>...          # the cached thumbnail of each
kdos thumb --path <file>      # where its thumbnail is or would be

Reads the shared freedesktop thumbnail cache, where Dolphin, Gwenview, a GTK file chooser and a script all find each other’s work. A thumbnail lives at $XDG_CACHE_HOME/thumbnails/<size>/<md5>.png, where the hash is taken over the file’s escaped file:// URI. The escaping and hashing come from libkbase, because one character escaped differently makes a thumbnail nothing else can find.

It writes nothing: KDE’s thumbnailers fill the cache the first time a file manager or a viewer shows a file. A thumbnail carries the file’s modification time in a Thumb::MTime text chunk, and one whose time differs from the file’s is reported as missing rather than handed out. Exit 0 when every file had a current thumbnail, 1 when any had none, 2 on bad usage.

kdos trash

kdos trash <file>...          # move to the trash
kdos trash --list             # what is in it (also -l)
kdos trash --restore <name>   # put one back where it came from
kdos trash --rm <name>        # delete one for good
kdos trash --empty [-y]       # delete all of it

Manages the freedesktop trash at ~/.local/share/Trash from a prompt, the same trash Dolphin shows at trash:/. --list shows each entry with its size, deletion time and original path, newest first. --empty is the only irreversible verb that acts on everything, and it asks first unless given -y; with no terminal to ask on, it refuses rather than assume yes.

The implementation is libkbase’s, and it guarantees:

kdos verify

kdos verify [--notify] [--] FILE...

Checks each file against what is beside it, with nothing fetched:

Check Where it looks Against
Checksum <file>.sha512, <file>.sha256, then SHA512SUMS and SHA256SUMS in the file’s directory The file’s SHA-512 or SHA-256. A per-file sidecar’s first hash line is the file’s whatever name it carries, since a download renamed afterwards keeps its sidecar; a list’s line must name the file. GNU (<hash> name, <hash> *name), BSD (SHA256 (name) = <hash>) and a bare hash are read
A pack’s signature A .kpack’s own signature block /etc/kdos/keys/packs ($KDOS_KEYS), after the pack’s bytes are shown to hash to its own digest
A signature sidecar <file>.sig in KDOS’s kdos-sig-1 form, which kpkg writes beside a package and a release’s SHA256SUMS /etc/kdos/keys ($KPKG_KEYRING). A checksum list with such a .sig is verified with it

A .sig in any other form, such as a GPG signature, is named and not checked. Each file gets one line: verified and every check that passed, FAILED and the check that did not, or not verified and why (no sidecar, an unsigned pack, a signature checked against a keyring that holds no key at all). A signature that none of the keyring’s keys verifies is FAILED whatever key id its line names, because the id is the signer’s own claim and a forger writes it too; the line names that claimed id and whether the keyring holds it: a signature by key <id>, which <keyring> does not hold for a signer never trusted, and a signature by key <id> that does not verify against that key in <keyring> for a trusted key’s signature over changed bytes or a damaged line. --notify also posts the verdict as a notification, which is how Dolphin’s Verify action (/usr/share/kio/servicemenus/kdos-verify.desktop, on every file) reports.

Exit Means
0 Every file passed at least one check and failed none
1 A check failed for at least one file
2 A file could not be read, or the command was used wrongly
3 Nothing vouches for at least one file, and none failed

Several files answer with the worst of them, in the order 1, 2, 3, 0. A file that nothing vouches for exits 3, never 0: unverifiable is not verified.

kdos share

kdos share FILE...
kdos share --clipboard
kdos share                   # a file dialog asks for a file

Sends files to another machine, paired by one code word. croc does the transfer; this command is the desktop around it. There is no account and no server: the two ends derive a key from the code word. The other machine receives with croc <code> in a terminal, and the sending window says so. Up to 32 files go in one transfer; a file:// URI is accepted wherever a path is. With no file, KDE’s own file dialog (kdialog) asks for one.

On KDOS, /usr/bin/croc is a wrapper that always passes --local, so a transfer stays on the local network and reaches no relay. croc-relay is the same binary with upstream’s default, for when you mean to use the public relay. The sending window therefore shows the code word and not the getcroc.com link croc prints beside it. croc is built with upstream’s croc_no_tailcat tag, which leaves out the Tailscale transport and croc ssh, because they run over Tailscale’s public servers and take no --local. croc is also patched (disable-update-check.patch) so that a send or a receive makes no request to api.github.com for the latest release, which --local alone would not stop: a transfer makes no connection but its own. croc update answers, with no request, that the system package manager updates croc, and only croc update --check asks GitHub.

Started without a terminal (from KRunner’s share.file route, Dolphin’s Send with a Code Word action or a menu), the command opens a Konsole window titled Share and runs itself inside it, so croc runs in the foreground where its own progress output is visible unchanged. At the end that window waits for Enter, so the result stays on screen. Typed at a prompt, it runs where it was typed. Outside a Plasma session there is no terminal emulator to open, so it also runs in place.

When croc prints the code word, the command also raises a notification naming it and draws the code as a QR code, in full blocks, so a phone can scan it. The QR is drawn only when it fits the window whole, because a partial QR cannot be read. The code is fed to qrencode on standard input rather than as an argument, because it is the transfer’s whole secret and a process’s command line is readable by every other process.

--clipboard sends the clipboard as clipboard.txt. croc sends files, so the text is written to $XDG_RUNTIME_DIR/kdos/clipboard.txt with mode 0600 rather than beside your documents, and it is read once, before any window opens.

kdos-share is a link to this binary, and kdos share is the same program under the spelling a person types; KRunner’s share.file and share.clipboard routes and mc’s F2 menu run kdos-share.

kdos hey

kdos hey list [--json]
kdos hey boxes
kdos hey run <action> <id>
kdos hey outputs [--json]

Asks KWin about the desktop, so a script can find a window and act on it. The window list is KWin’s org_kde_plasma_window_management Wayland global, which names every window by a uuid and reports its title, application id, process id, state and resource name; kdos-tools speaks that protocol itself rather than through libwayland-client. KWin offers it to clients outside a sandbox and refuses it to a box, so kdos hey works on the host and never from inside a box. The Wayland socket is $WAYLAND_DISPLAY, else the first of $XDG_RUNTIME_DIR/wayland-0 to wayland-32 that accepts a connection, so it answers from a timer service with no WAYLAND_DISPLAY too; KWin’s socket is wayland-1. A box’s own sockets are in subdirectories of the runtime directory and are never tried.

Verb Prints or does
list Every window: a row number (the id), ws (always -, kept as a column), state letters (F active, m minimised, M maximised, X fullscreen, a kept above, - none), app id, box and title (cut to 60 characters)
boxes The boxes that have a window on screen, one a line
run <action> <id> close, activate, minimize, unminimize, maximize, unmaximize, fullscreen, unfullscreen, keep-above or no-keep-above on the window with that row number or uuid
outputs The screens, from kscreen-doctor -o (or -j with --json); into a pipe or a file, without the colour codes kscreen-doctor writes regardless

list --json prints every window with its uuid, pid, app_id, resource, box (null for a host window), title and the four state flags.

A window’s box comes from its process: a box’s cgroup scope (app-kdos-<box>-<n>.scope) names the box where it has one, and otherwise the KDOS_BOX=<box> in the process’s environment does, when the process runs in a mount namespace other than the caller’s; kdos-appbox sets the variable in every box’s container and podman passes it to every launch. Failing both, a window whose app id is a running container’s name, or begins with it and a dot, is that box’s; the longest such name wins, so app.x does not claim app.xyz’s windows. The box column is never truncated, because a box is named after its pack and a cut name would read as a window with no box. kdos-box gc uses boxes to ask whether a box still has a window before stopping it.

kdos hey list                  # find the id
kdos hey run close 3

Exit 0 on success, an empty answer included; 1 when there is no Plasma session to ask (kdos hey: there is no Plasma session to ask), no such window, or the window closed before it was reached; 2 for an unknown action or bad usage.


Applications

kdos app

kdos app list [--all]
kdos app search <text>
kdos app info <id>                # also: show
kdos app groups
kdos app install <id|group>... [--dry-run]
kdos app install --pending
kdos app launch <id>
kdos app remove <id|group>...
kdos app export <file.ktar> <id|group>...
kdos app import <file.ktar> [<id>...]
kdos app tui add <name> <command> [--icon NAME] [--category X]
kdos app tui rm <slug>
kdos app tui ls

The command-line half of the application catalogue, over the same catalogue Discover’s KDOS backend reads (/usr/share/kdos/appstore/catalogue, asked through kdos-appbox catalogue). The user’s guide is Applications, the program that does the work is kdos-appbox, and Discover’s side is Discover.

Verb Does
list What is installed: the catalogue’s installed rows, then each deb.<package> box Discover’s Debian lane built (category Debian, from kdos-box list --json; a box described and not yet created is left out). --all lists the whole catalogue: 71 entries, the 69 applications and 2 datasets, which would bury the handful you have, and the Debian boxes after it
search Entries whose id, name, category or tagline contain the text, ignoring case; exit 1 when none do, with the line a port by that name: `kdos update install --dry-run <text>` shows what installing it takes, because a native program is a port and not in this catalogue
info One entry: name, category, state, the row it is built on, and its size labelled an estimate. For an application not installed, the size also gives the total with the base and runtime rows its install would build first, and names them: 8.6M (an estimate), 595M with rt-gtk and base, which this computer has not built. An unknown id gets the same port line as search
groups The catalogue’s named groups, which install, remove and export accept in place of an id
install Builds the application on this machine, which needs a network. --dry-run shows what would be built. Installing an application that is already installed rebuilds nothing: each image in its chain prints kdos/<id> is already here, the box create is refused because the box exists, and the command reports <id>: the image built and the box did not and exits non-zero. To take a newer build, remove the application and install it again, which rebuilds its own image and any runtime image no remaining box uses. There is no update verb
install --pending Installs what the installer was asked for and could not install itself, listed in /var/lib/kdos/apps-pending. The command deletes the file after a clean run, but the installer writes it as root and kdos app runs as the user, so the deletion fails and the file stays; a second run builds the whole list again
launch Installs the application if needed, then runs it from the rows of ~/.local/share/kdos/alien-apps whose pack column is the id. A row with a launcher column runs as its Start-menu entry does, kdos-appbox -b <pack> -l <launcher> run <command>, the command split as a desktop entry’s Exec (a quoted word stays one argument, field codes such as %F dropped), so its window takes the launcher id; of several, the one whose launcher id is the pack id or whose name is the id less app. goes first. An application with only command rows runs its shim from ~/.local/bin
remove Uninstalls. An id with no box, no profile and no image prints ==> <id> is not installed and exits 0, and a group’s members that are not installed are skipped the same way
export Writes the named applications into one .ktar set for another machine
import Installs from a .ktar set, offline, verified by kdos-packd as it installs each pack; name ids to take only some

Every verb that builds, removes, exports or imports runs kdos-appbox as a child, so the command line and Discover cannot disagree about what installing means.

Sizes are always labelled estimates. What apt resolves on the day depends on the snapshot, and shared runtime layers are counted once on disk however many applications use them.

Of these verbs only import needs kdos-packd, because it is the only one that mounts anything; the others work when the daemon is down. The path is never passed to the daemon: the set is copied into the daemon’s own staging directory and only a file name inside it is handed over, so a member of wheel cannot use it to mount an arbitrary device on an arbitrary directory.

kdos app tui

tui turns a terminal program into a menu entry without editing a file by hand:

kdos app tui add "Disk usage" ncdu --icon disk-usage-analyzer
kdos app tui ls
kdos app tui rm disk-usage

add writes ~/.local/share/applications/kdos-tui-<slug>.desktop, where the slug is the name in lower case with every run of other characters turned into one dash. The entry has Terminal=true, X-KDOS-TUI=true, Icon= (default system-run) and Categories= (default Utility), so the menu opens it in Konsole. The Exec line is written one quoted field at a time, so a path with a space in it survives. Every % in the command is written doubled, because a single % starts a field code in a desktop entry. An entry added this way opens its program; it is not a file handler.

rm accepts the slug with or without the kdos-tui- prefix, and deletes an entry only if it carries X-KDOS-TUI=true, so it cannot delete an application the image shipped. The prefix keeps new entries from shadowing shipped ones: a file in your data directory with the same name as one in /usr/share/applications would take the shipped entry off the menu.

tui writes only in your own data directory and needs neither kdos-packd nor membership of wheel.

kdos sandbox

kdos sandbox [profile] [--read P] [--write P] [--no-network] [--tcp PORT] -- <cmd> [args...]
kdos sandbox [profile] [options] --explain

Runs a native (not boxed) program under a filesystem and network filter built with Landlock, the kernel’s unprivileged access-control interface. It needs no container and no root. Every option maps onto a Landlock access right; confinement Landlock cannot enforce is not offered as an option.

Option Allows
--read P Reading under P
--write P Reading and writing under P
--no-network No TCP bind or connect at all (needs Landlock ABI 4)
--tcp PORT With --no-network, still allow outgoing TCP connections to PORT; without it the network is not restricted and this has no effect
--explain Print what would be allowed and what Landlock cannot police (UDP, unix sockets by path, processes and IPC), and run nothing

Everything else is refused, except a fixed base: /usr, /lib, /lib64, /bin, /sbin, /etc and /proc are readable, and /dev/null, /dev/zero, /dev/full, /dev/random, /dev/urandom, /dev/tty, /dev/ptmx and /dev/pts are writable. The rest of /dev is not, because that would hand over every disk and input device. A base path this system lacks is skipped; a path you name that does not exist is an error. At most 64 paths of each kind are accepted.

A profile is ~/.config/kdos/sandbox/<profile>.conf, parsed and never executed, one key = value per line; a key it does not know is reported and skipped. See Configuration.

read = /home/kdos/Music
write = /home/kdos/.cache/cmus
network = off
tcp-connect = 6600

The command is executed directly, never through a shell.

It refuses to run rather than run unconfined: with no Landlock in the kernel it exits with no Landlock (<reason>) — refusing to run unconfined, and --no-network on a kernel below ABI 4 exits with --no-network needs Landlock ABI 4, kernel has <n> — refusing to run with the network open. --explain reports the same conditions instead of running: it exits 1 when Landlock is unavailable, and marks the network REQUESTED OFF BUT NOT ENFORCED below ABI 4. A Landlock ruleset cannot be inspected from outside the process, so --explain describes what will be asked for, not what a running program holds.

kdos appid

kdos appid

Checks that every open window has the launcher it claims. The Task Manager matches a window to its launcher by file id: the window’s app id, which KWin reports as the desktop file name the application set or else its resource class, must be the basename of an installed .desktop entry. A window whose app id names no entry shows as a second, unnamed icon beside the launcher it came from, with no pin and no name, and nothing reports it, because the window works.

It asks KWin for every window open now, as kdos hey does, and looks for <app id>.desktop in the applications directory of $XDG_DATA_HOME and of each $XDG_DATA_DIRS entry, printing one line per window:

<app id>    OK|MISMATCH <title>

NoDisplay=true is a match: it keeps an entry out of the menu, not out of the Task Manager, which resolves a window to it all the same. Hidden=true is the specification’s “this entry is deleted” and matches nothing. A boxed window’s app id is its box’s launcher id, which kdos-appbox names its launchers by, so a box’s windows match by construction; see Naming rules. The fix for a host mismatch is to name the .desktop file after the app id: the file name is what is matched, not Name and not StartupWMClass.

Exit 0 with no mismatch, 1 with any, 2 when there is no session to ask.


Diagnosis

kdos why and kdos explain

kdos why <path|port>
kdos explain [topic]

Both read the reasons corpus: 52 short documents installed under /usr/share/kdos/reasons, each stating a constraint in the system and its consequence. $KDOS_REASONS names another directory, which is how the corpus is read from a checkout. Each document starts with a header of title:, cite:, path: and port: lines.

why answers what provides a path or a port and why it is configured that way. For an absolute path it first prints the owning package and version, from the package database’s own file list, and the recipe it was built from. A path no package owns is reported as none — provided by fs/ or 10_bootstrap, or not installed: files from the base filesystem tree are copied into the image rather than installed by a package, and 10_bootstrap compiles kpkg (with its four other names and /etc/kpkg.conf) and kinstall straight into the root, so that is a common answer. It then prints in full every reason whose path: names the path or a directory above it, or whose port: names the port. Any other word is looked up as a port and a package: why prints the installed package’s version and the recipe when there is one, and every reason whose port: names it. A word that is no port, no installed package and no reason’s subject prints no such port or package, and no recorded reason names it. and exits 1, so a typo is not taken for a port that needs no explaining.

explain browses the corpus. With no topic it lists every reason’s title. With a topic it prints in full each reason that mentions the topic anywhere, ignoring case, so kdos explain musl finds the reasons that mention musl in passing. Exit 1 when no reasons are installed.

A reason cannot describe a file or a port that has gone: the tree’s checks (testing/preflight.sh) fail when a reason’s path: or port: names something the tree does not have.

kdos oracle

kdos oracle [--plain]

Prints one reason from the same corpus as title · citation. The choice is keyed on the day combined with the boot’s identifier, so the line stays the same all day and changes after a reboot. On a terminal it is printed in the accent’s secondary colour; --plain prints it without colour, which is also what happens when the output is not a terminal. Exit 1 when no reasons are installed.

kdos restarts

kdos restarts [--quiet] [--json]

Lists running processes that still use code an upgrade has replaced or removed:

These are running code that has been replaced or removed.
They keep the old version until they restart:

  pipewire         (pid 2841)  pipewire, alsa-lib
  plasmashell      (pid 3122)  plasma-workspace

2 processes. Restarting them puts the new code in effect.

After an upgrade, a process that had the old shared library mapped keeps running it until it restarts. That is what makes upgrading a running system safe, and it also means a security fix is not in effect for that process yet. This command joins two exact sources: /proc/<pid>/maps, where the kernel marks a mapping whose file was deleted, and kpkg’s file manifest, which says which package owned it. Only an executable mapping (its permissions contain x, such as r-xp) of a deleted file under /usr, /lib*, /bin, /sbin and /opt is considered. A deleted shared-memory mapping (a memfd, /SYSV, /dev/zero) is normal, and a cache or data file mapped for reading (icon-theme.cache, the MIME and font caches, a locale archive) is not code: every install’s index triggers rewrite those files under every running program. So installing an application lists nothing, while a replaced library or program, which always maps its text executable, is still reported, and kdos-notice raises its log-out notice only for that. A mapping no installed package owns is reported as no installed package owns it rather than guessed at, and a process whose maps cannot be read (another user’s, or one that exited during the scan) is skipped.

A process is told as running replaced code or removed code by the paths of its deleted mappings, looked up in its own root (/proc/<pid>/root, so a boxed process is looked up in its box’s tree): replaced when one of them names a file again, or a library’s versioned name (libssl.so.3.0.15) does with a trailing version taken off (libssl.so.3); removed when none does, as after kdos update remove of a program still open. A removed one is listed with removed, no newer version in place of its packages, and kdos-notice raises no notice for it, since there is nothing newer to restart into; a root that cannot be looked into counts as replaced. The closing line asks for a restart only of the replaced ones, and a list of removed programs alone ends by saying there is no newer version to restart into. A program whose update moved its files to another path, such as a new Python’s /usr/bin/python3.13 beside a running python3.12, reads as removed.

The list stops at 256 processes and says so. --quiet (-q) prints nothing. --json prints {"truncated", "processes": [{"pid", "comm", "exe", "replaced", "packages"}], "count"}, replaced true or false as above, every listed process counted.

Exit Means
0 Nothing is running replaced code: no process is listed, or every listed one runs a removed program
1 At least one listed process runs replaced code, the list stopped at 256, or /proc is not mounted
2 Bad option

kdos privacy

kdos privacy                    # who has what, for a person
kdos privacy --json             # one line, now
kdos privacy --watch --json     # that line, and again at every change
kdos privacy mute|unmute <id>   # a microphone stream
kdos privacy stop <id>          # a camera or screen capture

Says who has the microphone, the camera and the screen. The answer is PipeWire’s, plus the kernel’s for a camera opened without it:

Device In use when
Microphone A running Stream/Input/Audio node exists, named by the process that owns it
Camera A camera source (v4l2 or libcamera) has an active link, named by the stream at the other end; or a process holds a /dev/video* open itself, which PipeWire never sees
Screen A KWin screencast stream (a Stream/Output/Video node whose application, by binary or name on the node or its client, is kwin_wayland) has an active link, one entry per link, named by the stream that reads it, whether Spectacle, OBS or the desktop portal asked for it; or any other video source has an active link. A KWin stream read by the Plasma shell itself, the task manager’s hover thumbnail, is left out (below). Another program’s video output stream is not listed

Each user is named with the box it runs in, from its cgroup, because “Firefox has the microphone” is a different sentence when Firefox is a box kept for one website. --watch follows pw-dump --monitor rather than polling it, and runs the camera’s file-descriptor scan on inotify: an open or close of a /dev/video* node, or one appearing in /dev, rescans, and the scan runs again a quarter second later for an opener whose descriptor was not yet listed. Where inotify cannot be set up the scan runs every half second instead. With no /dev/video* node the scan returns at once, so a machine with no camera never walks /proc. The tray’s privacy lamps read it (see Privacy lamps).

The task manager’s window thumbnails are KWin streams read by plasmashell, and they are not a screen capture, so hovering a task does not light the screen lamp and stop cannot target one. The reader is taken to be the shell only on values the PipeWire server sets, never on what a client says about itself: its node’s client.id must name a PipeWire client whose pipewire.sec.pid (from the socket’s peer credentials) runs the same file, by device and inode, as /usr/bin/plasmashell, in no box. A program that only names itself plasmashell (application.name, application.process.binary, PIPEWIRE_PROPS), a box’s own plasmashell, and a reader whose pid or executable cannot be read are all listed as screen captures under the name they give. Other video sources, KWin’s screencast source and cameras among them, are listed whoever reads them, the shell included.

stop ends a screen capture by destroying KWin’s stream node for it: KWin closes the screencast, so the program that asked is told — Spectacle stops and reports that the stream closed, and a program sharing the screen through the portal sees its session end. A camera, or any other video source, is shared, so stop destroys only the link that feeds the one stream; its frames stop, and the program is not told. A camera opened without PipeWire cannot be stopped from here.

Exit 0; 1 when PipeWire cannot be read or an action failed, with the reason on standard error; 2 on bad usage, which the tray takes as “stop retrying”.

kdos cve

kdos cve [--json] [<port>]

Offline vulnerability tracking: every installed package is compared against a pruned copy of the Alpine security database vendored into the image at /usr/share/kdos/secdb.txt (override with $KDOS_SECDB). Alpine is the proxy because it also builds on musl from the same upstream releases. The comparison uses kpkg’s version comparator: a package is behind when its version is older than the one Alpine records as fixing a CVE on the version’s own branch, or, for a CVE that branch has no row for, older than every recorded fix. A CVE that a later branch also fixed is not counted against a version whose own release already closed it. Nothing is scanned and nothing is fetched. Details are in Packaging.

Name a port to check only that one. One name at most: a second, or an option other than --json, prints the usage line and exits 2 rather than checking only the last name given. On a system with no package database, the recipes in the ports tree are checked instead. The report gives the database’s date and age, each package that is behind a recorded fix with the first three CVEs and a count of the rest, and a summary line. A database more than 180 days old is flagged, with the reminder that a newer one arrives with kdos-tools (through kdos update) or that KDOS_SECDB can name another.

A package is looked up under its own name, or under the name its recipe gives in secdb =. One the database does not carry is unknown, never clean, and the summary says how many are in that state. --json prints every finding with all its CVEs.

A library a port compiles into its own binary is in no package database, so a second file, /usr/share/kdos/bundled.txt (override with $KDOS_BUNDLED), lists each one as <port> <crate> <component> <version>. Every row whose port is checked is looked up under the component’s name: a version behind a recorded fix is a finding named <port>/<component>, and every row is listed under bundled copies, with the ones the database does not carry marked. --json gives them as the bundled array.

Exit Means
0 Nothing known-vulnerable
1 At least one package is behind a recorded fix
2 No database at the expected path, a second port name, or an unknown option

The system

kdos update

kdos update [check [--json] [--out PATH] [--fetch]]
kdos update fetch [--from URL|DIR] [--binhost-only]
kdos update apply [--image | --binhost | --source] [--acquire | --arm] [--mount]
                  [--dry-run] [--root DIR] [--in-place] [--progress FD]
kdos update install [--dry-run] [--prebuilt | --source] [--build-deps=prebuilt|source]
                    [--root DIR] <port|group>
kdos update install [--dry-run] [--prebuilt | --source] --pending
kdos update install [--dry-run] --dev [--deps] [--root DIR] <port|group>...
kdos update remove [--dry-run] <port>
kdos update removable [--json]
kdos update groups [--json]
kdos update notes [--json]
kdos update theme

Updates the system, and installs host software outside the image. A recipe pins its version, so what is newer arrives with the ports tree and nowhere else. Every image carries the tree at /ports, recipes only, with no source tarball:

An update is two steps:

Discover drives the same two steps through kdos-sysupdated, and Discover is the graphical side.

/etc/kpkg.conf’s default PORT_REPO names /ports/core and the four areas of /ports/src; PORT_REPO can point at a checkout instead. Each directory PORT_REPO names is searched for a port at <name>/ and one shelf down at <shelf>/<name>/, and the first directory holding a name wins. A tree that files one name twice inside one directory, or nests a port below its shelf, stops check, apply and kdos cve with both paths named, because either recipe could be the one that counts.

Verb Does
check What is behind, what is offered and what went wrong; the default verb, read from what the last fetch left
fetch Takes the newest signed ports tree, the binary-host index and the slot image manifest from the network
apply Fills the inactive slot and makes it the next boot’s candidate (Applying)
install Puts one port, or a group, and what it lacks into the running root
remove Takes out a port somebody installed, with the packages it brought
removable Lists what remove would take, and what it would keep and why
groups Lists the tree’s groups and what installing each would add
notes Prints the release notes of the version running
theme Applies the accent in force again

check is the default when no argument is given; name it to pass an option. It prints:

check asks no server: it reads what the last fetch left. With no fetch line in update.state, as on a machine that has never fetched, it says so before the counts: no fetch is recorded yet: `sudo kdos update fetch` (or `sudo kdos update check --fetch`) asks the release server.

With no binary-host index on the machine, the binhost: line names the one step that would get one, taking the first of these that applies:

  1. Something is behind and this is not the live medium: kdos update apply --source builds it, after the keys step of case 4 when the keys are why there is no index.
  2. update.conf or $KDOS_UPDATE_BINHOST names an http:// binhost: `binhost =` in /etc/kdos/update.conf or $KDOS_UPDATE_BINHOST names an http:// URL, which kdos update refuses (curl --proto =https,file); name an https:// URL or a directory, because the fetch would be refused the same way.
  3. The last fetch of the base named now found no binhost there: the last fetch found no binhost published at <base>; publish one there or name another with `binhost =` in /etc/kdos/update.conf, because the fetch would find none again.
  4. The keys are why there is no index: /etc/kdos/keys holds no key, the last fetch of the base named now was refused over a signature, or the index in place does not verify against the ring (a no-key refusal once the ring holds keys again is left to the fetch). The line reads the keys in /etc/kdos/keys verify no signed index of this release; put this release's public keys there (kdos-release.pub, on the release page, and kdos-binhost.pub; /etc/kdos/keys on its ISO holds both), then `sudo kdos update fetch --binhost-only`, because the fetch alone would be refused the same way.
  5. update.conf, $KDOS_UPDATE_BINHOST or the tree names a binhost: sudo kdos update fetch --binhost-only takes the release’s signed index.
  6. Otherwise the tree names no release, and sudo kdos update fetch takes a published tree that does. When the last fetch refused the published tree as older than this machine’s, the line names only binhost = in update.conf instead.

A recorded problem that is a refusal over the keys ends with the same kind of step. A tree fetch refused for want of a key, or over its signature, ends with the keys in /etc/kdos/keys/tree verify no tree of this release; put this release's public key there (kdos-release.pub, on the release page and in /etc/kdos/keys/tree on its ISO), then `sudo kdos update fetch`. A binhost-no-key or binhost-unverified problem over a signature, when an index is in place and the binhost: line has not named the step, ends with the binary-host keys step of case 4, or with sudo kdos update fetch --binhost-only when the ring now holds keys and the refusal was no-key.

When the index in place came from another base (its ORIGIN is not the base named now, as after binhost = changes and the fetch of the new base found nothing), a warning line says so: binhost: the index in place is from <origin>, not <base> that <update.conf, $KDOS_UPDATE_BINHOST or this tree's release> names; the last fetch of <base>: <detail>; installs still read the index in place, where the detail is the last fetch of <base> found no binhost there or no fetch of <base> is recorded. The index is kept, and install and apply keep reading it: it is signed by a trusted key, and each package is still checked against this tree’s recipe hashes.

A machine with no inactive slot is offered no image: its image: line reads slot image <version> is on offer, but this machine has one slot (but this is the live medium on the live medium), and the document’s offer, lane and image describe the binary host alone.

Option Does
--json Prints the same as one document, the update document below
--out PATH Writes that document atomically to PATH; implies --json
--fetch Runs fetch first

Exit 0 up to date, 1 something behind or an image offered to this machine, 2 nothing could be surveyed.

fetch downloads the newest published tree, checks its signature and installs it as /ports, then fetches the release index and, through it, the binary-host index and the slot image manifest. --binhost-only fetches only the release index and the binary-host index of the tree in place, neither a newer tree nor the image manifest, because a newer tree’s packages are built against a newer base than this one runs; the live medium and the installer fetch this way.

Each part checks its key before it touches the network. With no key in /etc/kdos/keys/tree the tree is not downloaded and fetch records no-key; with none in /etc/kdos/keys neither the binary-host index nor the image manifest is downloaded, and each records no-key on its own line.

When no binary host is named, or none is published at the address, --binhost-only exits 1 and says why on standard error, and a full fetch prints the same line with its own exit status:

A release index or binary-host index that cannot be taken exits 1 and says why on standard error as it happens. The text is the one check later reports on its binhost-<code> line:

Message Code Means
kdos update: the release index at <base> could not be downloaded fetch-failed The download failed
kdos update: the server at <host:port> did not answer fetch-failed The connection was refused or timed out, on a machine with a default route
kdos update: the download from <host:port> stalled: less than 1024 bytes a second arrived for 60 seconds fetch-failed The server answered and then stopped. Every download of kdos update ends a transfer that slow, after curl’s --retry 2 has started it again twice
kdos update: the network could not be reached for the release index at <base> no-network A name that did not resolve, or a refusal or timeout with no default route in /proc/net/route or /proc/net/ipv6_route
the reason, followed by — it was not kept unverified The index does not verify
kdos update: no trusted key in /etc/kdos/keys can verify a release index no-key No key to check it with

An http:// base is refused by curl before any connection, because curl runs with --proto =https,file, and the refusal is followed by kdos update: binhost takes an https:// URL or a directory; curl runs with --proto =https,file. The state line check reports carries the reason followed by ; binhost takes an https:// URL or a directory, the reason cut short where the two would pass 255 bytes.

The slot image manifest’s outcome is printed last: slot image: <version>, signed by key <id>; slot image: none published; updates come from the binary host when the release publishes none, which is not a failure; or, on standard error, kdos update: slot image: <reason> for a manifest that could not be fetched, was offline or had no key, with — it was not kept after one that does not verify.

Exit 0 installed or already current, 1 refused or failed, 2 not attempted (not root, another update running, or /ports inside a git checkout).

apply fills the inactive slot (the acquire) and makes it the next boot’s candidate (the arm); Applying below describes it in full. A prebuilt apply (the binhost lane, and the world step after a slot image) carries what the world packages run with, not what they were built with: their dependencies are cut by the index’s N: lines from every package it installs at once, as a prebuilt install cuts one port’s, keeping every edge of a package built here. --source keeps every edge.

install <port|group> puts one port and every package it lacks into the running root, by one of two routes, --prebuilt or --source; Install routes and groups says which is the default and what each records. Discover’s ports helpers run it through pkexec. Exit 0 installed or already was, 1 refused or failed, 2 usage.

The prebuilt route and its index. --prebuilt takes the packages from the release binary host that fetch keeps. A machine that has no index yet, such as a fresh install or the live medium, fetches its release’s index first, as fetch --binhost-only does; a dry run, which changes nothing, names that command instead. With still no index the install is refused with kdos update: no signed binhost index is on this machine and a second line:

For an http:// binhost each of the last two names the https:// rule of check’s binhost: line in place of the fetch. When the keys are why there is no index, as in case 4 of check, the second line is kdos update: and that keys step instead, whether or not the install fetched.

A package the signed index does not cover refuses the whole install, naming kdos update install --source <port>.

Build-only ports are left out. The prebuilt route can leave out the ports a package was only built with. When the tree carries /ports/buildonly, an edge into a port it lists is followed only where that package’s whole-package stanza in the index names the port on an N: line; an empty N: line drops every such edge, and a stanza with no N: line keeps them all. The port asked for always stays. The image’s tree and every published tree carry buildonly, and the published index an N: line per package, so a prebuilt wesnoth takes boost, which its line names, and a prebuilt kcharselect, whose line is empty, takes no CMake, Sphinx or pip.

--source cuts its order the same way, except that the port and every package the run builds follow every edge, so a prebuilt extra-cmake-modules comes without Sphinx or the Python build backends. A build first installs, prebuilt, each port of /ports/buildheaders (xorgproto, xcb-proto, wayland-protocols, …) that a package it compiles against names and that is not installed (Building here).

Space is checked before anything is downloaded. Three measurements are made, and an install that fails any of them is refused with exit 1. --dry-run prints its plan, then the same line without its tail (; nothing was downloaded and the like), and exits 1 too.

  1. The download cache. The bytes to fetch are compared with the free space where the cache is: kdos update: the packages to download take <size> and <cache> has <size> free; nothing was downloaded.
  2. The root the packages go into (--root DIR, or /). The sum of the packages’ installed sizes, from their index stanzas’ I: lines (the index), counting the build tools and other packages a building run installs prebuilt first; plus the downloads when the cache is on the same filesystem; plus 128 MiB kept free. That is compared with what an ordinary user may still write there, the blocks reserved for root left out. Development files restored to packages already installed count only as downloads. The refusal is kdos update: the packages take <size> once installed and <root> has <size> free; nothing was downloaded, or … once installed and their downloads <size> more in <cache>, and <root> has <size> free; … when the cache shares the root. A group is measured whole before its first member (its members’ run-time closure less what is installed), and one that does not fit is refused once, with the line ending ; nothing in <group> was downloaded (; <group> does not fit under --dry-run), so members that each fit cannot fill the root between them. A stanza without I: adds nothing, and an index without any is checked for its downloads alone.
  3. The build directory, for a run that builds. An estimate of the room its builds need in kpkg’s work directory is compared with the free space there, once before anything is fetched and again once every source is. The estimate is six times the source archives of the largest build, plus each other distinct archive once, plus 512 MiB once a run; an archive not yet on the machine counts at the size kpkg fetch --size reads where it would be downloaded (see Building here). The refusal is kdos update: building <ports> needs about <size> in /var/cache/kpkg/work and the root has <size> free; nothing was downloaded (; nothing was built at the second check). --dry-run prints the estimate as build-space <bytes> after its total. An archive no server gave a size for counts nothing, and the dry run names it on standard error: kdos update: the size of <n> source archive(s) (<files>) is not known until they are downloaded; the space is checked again after the download.

When a build fails. Every build it starts runs under KPKG_CLEAN_FAILED=1, so a failed one removes its work directory, and the failure line says why:

Line When
kdos update: <port> did not install: the root filled up while building it (<size> left), and its work directory was removed The work directory’s filesystem had 64 MiB or less, or under 1%, left as the build failed. When a dependency’s build did, the line reads while building <dep>, which it needs (<size> left), and the work directory of <dep> was removed
kdos update: <port> did not install: its build failed; the log is above Any other failed build
kdos update: <port> did not install; the log is above The build succeeded and the install after it failed; : the root is full (<size> left); the log is above when the root is full

With KDOS_UPDATE_LOG set, as kdos-ports-builder sets it to the file it keeps the run’s output in, each the log is above reads the build's log is in <file>. The line is about that port only: what the run installed before it stays installed. A build that is stopped or killed removes nothing, and /var/cache/kpkg/work/<port> stays until it is deleted or the port is built again.

Downloads. Every package download ends when less than 1024 bytes a second arrive for 60 seconds, so a connection that stalls fails the install rather than holding it, and Discover’s transaction, for ever. curl retries twice, and a package that still stalls part way is kept as a cut download, which the next run continues: kdos update: <file> stalled at <n> of <size> bytes: less than 1024 bytes a second arrived for 60 seconds; nothing was installed — run the same command again to continue the download (pressing Install again continues the download under Discover). On the live medium each package file and its .sig are deleted from the cache once the package is installed, because the cache is in the same RAM overlay as the root it was unpacked into.

What is installed, and what is recorded.

Option Does
--prebuilt, --source Pick the route; --source builds the port here (below)
--build-deps=prebuilt\|source For a source install, whether the dependencies the machine lacks are downloaded or built
--root DIR Install into a root that is not running; prebuilt only
--pending Install what the installer recorded and could not install. When dependencies come prebuilt, a refused index fetch, or one that finds no index to take, stops it after the first group and leaves the rest pending (below)
--dev Install installed ports again whole, bringing back the development and documentation files the image’s FACETS=run left out (Development files)
--dev --deps The same, and for what a build against them compiles against too
--dry-run Decide everything, change nothing, print the plan

remove <port> takes a port somebody installed out of the running root, with the packages it brought, each by kpkg remove, which also takes it off the world set and the origin record so the next update does not install it again. Discover’s kdos-ports-helper remove runs it through pkexec.

--dry-run prints remove <pkg> for each package the removal would take, the port first, and changes nothing. Without it the removal needs root, takes the update lock and decides again under it. Exit 0 removed (or would be), 1 refused or failed, 2 usage.

removable prints, one a line, the installed world packages that are not of the image and that no installed package depends on: what remove takes. Then come two lists, each under its heading line and each printed only when it is not empty:

kpkg’s database records no dependency edges, so each installed package’s recipe in the tree in place gives them, read as the solver reads them and cut as a prebuilt install cuts them. An edge into a port ports/buildonly lists is kept only when the package’s stanza in the verified binhost index names that port on its N: line, carries no N: line, or is for another version or release than the one installed, so a package that only compiled against a build-only port does not hold it. A package built here (origin source) keeps every edge of its own recipe, since an update builds it here again, so the build dependencies it names stay with it and go with its removal. With no verified index, or a tree without ports/buildonly, every recipe edge holds.

--json prints {"removable":[...],"needed":{"<pkg>":"<an installed package that depends on it>"},"left":[...]}, needed holding the installed world packages not of the image that are not removable and left the packages left by removals; Discover’s backend reads it at each refresh. Exit 0.

groups lists every group of the tree’s groups file: whether all of it is installed, how many of its members are not, how many packages installing it would add, and, with the signed binary-host index in place and every one of those packages prebuilt, their download size. With no index it first prints no binhost index here, so no sizes: and the step check names.

--json prints an array of {"id", "title", "ports", "installed", "missing", "packages", "binhost", "size"}. size is null when no size can be given. binhost is false when no index is in place, nothing names a binary host for the tree (no binhost = in update.conf, no $KDOS_UPDATE_BINHOST, no release-named TREE) and no refresh can name one: the binhost line of update.state says no binhost is named for this tree, its fetch line says the published tree is older than this machine’s, or kdos-bootctl says this machine has no second slot (a refresh there is fetch --binhost-only, which takes no tree). It is true otherwise, including a tree a refresh may yet give a name. Exit 0.

notes prints the release notes of the slot this boot runs, /ports/RELEASE. Every image carries it, copied from ports/RELEASE of the checkout it was built from, and every published tree (kdos-ports.tar.xz) carries the tag’s; the image build and ports/publish --release both refuse a missing one or one over 16 KiB, the most notes reads. The welcome tour’s What’s New page reads it.

The plain output’s first line is KDOS <version>, followed by , updated from <previous> or , went back from <previous> in the two cases below, and by nothing on a fresh install. --json prints {"version", "previous", "went_back", "live", "notes"}:

Key Holds
version The version running
previous The version the other slot holds, when this boot came from it or went back from it; "" when it is neither: a fresh install (the installer records both slots alike, so the other slot holds this version or tree), the live medium, and an other slot that is armed, incomplete or empty
went_back true when this slot is the older one: the other slot’s last trial ended unconfirmed (kdos-bootctl status reports it failed, which counts even when its tree is this slot’s, as for a release rebuilt from the same commit), or its tree is later than this one’s, a newer version left by picking this one by hand
live true on the live medium, which has no slots
notes The notes, as Markdown

Exit 1 with no document when the slot carries no notes.

theme applies the accent in force again, exactly as kdos theme <accent> does, so the copies under $HOME are regenerated from artwork an update replaced.

Where a tree comes from. fetch reads kdos-ports.tar.xz and kdos-ports.tar.xz.sig from the first of these that is set:

  1. --from URL|DIR;
  2. $KDOS_UPDATE_TREE;
  3. tree = in /etc/kdos/update.conf;
  4. the latest KDOS release on GitHub, https://github.com/kunaldawn/kdos/releases/latest/download.

A value with no scheme is a directory holding the two files, such as a USB stick. Only HTTPS or a local path is read, and no redirect to plain HTTP is followed. A download of either file that gets no answer in 30 seconds, or in which less than 1024 bytes a second arrive for 60 seconds, is tried twice more and then fails as kdos update: <url> timed out: the server did not answer in 30 seconds, or less than 1024 bytes a second arrived for 60 seconds (fetch-failed); on a machine with no default route it is no-network.

The tree is trusted by its signature:

Which tree is taken:

The old tree and the new one change places in one rename. On the live medium /ports lies in the overlay’s read-only lower layer, which cannot be renamed, so there the old entries are removed and the new ones moved in one at a time.

Where the binary host comes from. The binary-host index and its packages are read from binhost = in /etc/kdos/update.conf, else $KDOS_UPDATE_BINHOST, else the release the tree names: /ports/TREE’s version <tag> line gives https://github.com/kunaldawn/kdos/releases/download/<tag>. An image built from a clean checkout of a tagged commit names its release that way, and so does every published tree, so either finds its binary host with no configuration. Any other image’s TREE names only its commit; there prebuilt installs need binhost = or $KDOS_UPDATE_BINHOST, or a fetch of a published tree. When the published tree is the same commit as an installed one that names no release, fetch installs it in place of /ports (<root> now holds tree <commit> (signed by key <id>)), so the next run finds the release; a same-commit tree counts as current only once the installed one names a release.

The update document. check --json prints, and check --out writes, one line of JSON: the document kdos-sysupdated serves Discover from, kdos-notice watches and the System Versions page reads.

Keys Hold
behind, orphans, packages What is older than its recipe, each with binary, whether the binary host covers it; installed packages with no recipe
tree, version, date The tree in place, the version it is, and the day (UTC) its commit was made, or the offered image’s when the lane is image; Discover shows it as the release date
installed The version this system says it is
covered, uncovered, size How much of behind the binary host covers, and the bytes still to download; a package whose origin is source counts as covered, since the update builds it here
builds How many of behind the update builds here rather than downloads
offer, lane The version an update would make this system, and from where: image or binhost
signed_by, verified, binhost, image The key that signed what is offered, when it was verified, and where the index in place (its ORIGIN) and the image come from
binhost_base The binary host named now: binhost = in update.conf, $KDOS_UPDATE_BINHOST or the tree’s release; null when nothing names one. A binhost- problem is about this base, and Discover names it in its warning
channel, notes, checked The tree source in effect, the tree’s release notes, and the time of this check
problem, detail The worst recorded problem

It answers in JSON even when it cannot answer: no tree is "behind":0 with "problem":"no-tree". A prebuilt package is offered only when the whole set is prebuilt: kpkg’s three equality tests (architecture, build-configuration hash, recipe hash) decide each package, and one that fails them refuses the binhost lane with N packages need a source build, because a slot half from the binary host and half from a compiler is a slot nobody tested. check runs the same tests against the cached index, so what it offers is exactly what apply will take.

What went wrong is recorded. fetch and apply write their outcome to /var/lib/kdos/update.state, and check reports the first problem it finds, in this order, worst first:

  1. no-tree.
  2. The last fetch’s no-key, no-network or fetch-failed. These cover the release index too: one no key in /etc/kdos/keys could verify (no-key), one that did not verify, or a file other than the one the release index names.
  3. The binary host’s binhost-no-key, binhost-no-network, binhost-fetch-failed or binhost-unverified; and binhost-absent when the last fetch found no binary host published at the base that update.conf or $KDOS_UPDATE_BINHOST names, or that the tree’s release names while the index in place came from another base.
  4. The slot image’s image-no-key, image-no-network, image-fetch-failed or image-unverified.
  5. The last apply’s no-network, fetch-failed or build-failed.
  6. Last, the fetch’s fetch-failed that refused the published tree as older than this machine’s. That refusal is no cut-off: the machine is ahead of the release, so it ranks below every other problem and never hides a binary-host one.

Each binary-host result is kept with the base it was fetched from (the binhost-at line of update.state), and one for a base other than the one update.conf, $KDOS_UPDATE_BINHOST or the tree names is not reported, so no problem line names an address that is not configured. A machine with a tree and no package database reports no-database and exits 2.

The document is kept fresh without anyone asking. The nightly timer (/etc/kdos/timers.d/10-update-check.timer) runs kdos update check --out /var/lib/kdos/update.json, which reads only what is already on the machine and fetches nothing; kdos-sysupdated’s CheckNew fetches at most once an hour; and fetch and apply rewrite the document when they finish.

Applying

apply is two halves, because Discover shows progress for the first and not the second:

The version a slot filled from a tree records has the form the image build gives its own record, so the two slots read alike in System Versions and on the logout screen: a tree that names its release gives that name without its tag’s v (0.2), any other the slot’s os-release VERSION_ID (the running root’s when the slot has none) with + and the tree’s commit as its TREE file records it, twelve characters (0.2+4dc1f7f826a3: an image’s own tree carries the image build’s short hash, so both slots name the commit alike). A slot filled from the running root’s own tree (the commit its /etc/kdos-release names as TREE) when that tree names no release takes the running root’s VERSION and BUILD_ID as they stand, -dirty included, so the two slots of one tree read alike; a tree that names a release keeps that name even at the running root’s commit. A tree records no dirty state of its own, so a slot of any other tree never carries -dirty. A slot filled from an image records the version the image’s manifest names.

apply with neither runs both, which is what a person types. --mount mounts the inactive slot itself at /run/kdos/slot-<x> (kdos-sysupdated passes it); without it the slot must already be mounted, which on a freshly installed A/B machine it is not, so the command to type there is sudo kdos update apply --mount. A dry run mounts nothing: --dry-run --mount on an unmounted slot prints dry run: slot <x> (<uuid>) is not mounted; without --dry-run, --mount mounts it at /run/kdos/slot-<x> and installs the candidate there and exits 0. An unmounted slot cannot be read, but the boot state’s unfilled mark can: when it names the slot, the line is dry run: slot <x> (<uuid>) is not mounted, and an update stopped while writing it; without --dry-run, --mount mounts it at /run/kdos/slot-<x> and finishes it: what it lacks is installed, and a slot that then holds the version running is made complete again without a trial, and the refusal without --mount adds ; an update stopped while writing it, and --mount finishes it. On a trial boot the inactive slot is the confirmed one, the way back, and nothing is written into it. On the live medium, which kdos-bootctl status --json reports as "live": true, apply is refused with this is the live medium: what an update installs here is gone at the next restart unless a persistence store keeps it. Install KDOS to update it, or pass --in-place to update this session anyway, because its root is an overlay in RAM; --in-place updates the session anyway.

Lane What apply does
Image Writes the signed slot image into the slot with kdos image unpack’s synchroniser, seeded from the running root, so only what changed is downloaded. A slot image is the base alone, so the world set follows it: every world package and each dependency it lacks goes into the slot from the same release’s binary host, or is built there when its origin is source. Before the slot is written every world package and its dependencies are walked, and one by the prebuilt route that the binary host does not cover refuses the image lane with N package(s) of what was installed on purpose is/are not in release X's binhost (…), nothing written. What the running root keeps whole follows too: under FACETS=run, a package with development or documentation files and no facet record, as install --dev or a build here leaves one, is installed whole in the slot, by the world step when it installs the package and again whole after it when the image brought the package stripped, prebuilt or built here again by its origin. One by the prebuilt route the binary host does not cover refuses the lane before the slot is written, with N package(s) this system keeps whole is/are not in release X's binhost (…), and --dry-run lists each as <pkg> kept whole: <file> or built here again. A machine with neither a world set nor a package kept whole has no such step
Binhost Takes each package by the route its origin records: a prebuilt one has its file and delta fetched and checked against the signed index and is installed under KPKG_REQUIRE_SIG, and a source one has its sources fetched and is built with kpkg install. Every file and source is fetched before the first install, and all of it is installed inside a chroot of the slot, dependencies first. Into a slot, what the running root keeps whole is installed whole there, as in the image lane. Only the prebuilt packages need the index; one it does not cover refuses the lane
Source Fetches every source with kpkg fetch, from the sources-<N> archive first, then upstream, before it builds anything, then builds and installs each package with kpkg install -f in a chroot of the slot (/proc, /sys, /dev, the ports tree, the source cache and /etc/resolv.conf bound in, each a slave of the running root’s mounts, so unmounting them leaves the running system’s /dev/pts, /sys/fs/cgroup and efivarfs in place), so every package compiles against the slot’s own libraries. Hours on a large set

Every package apply builds, in any lane, is built under KPKG_CLEAN_FAILED=1, as an install builds: a failed build removes its work directory and prints the <port> did not install: … line that says whether the root filled up. The binhost and source lanes check the room their builds need as an install does, before anything is fetched and again once every source is: a run that does not fit is refused with kdos update: building <ports> needs about <size> in /var/cache/kpkg/work and the root has <size> free; nothing was downloaded (; nothing was built at the second check, the slot has when the builds run in the other slot), exit 3, the slot untouched; after a slot image has been written the same line is a failure, exit 1. --dry-run prints build-space <bytes> after its plan when the lane builds anything, and the same refusal without the tail.

Option Does
--image, --binhost, --source Pick the lane. With none of them an image on offer is taken where there is a slot (or a --root) to write it into; with one root, or --in-place, it is passed over with one line and the binhost lane runs, while --image there is refused with a slot image is written into the inactive A/B slot, and this run has none; `kdos update apply --binhost` installs into the running root
--acquire, --arm Run one half
--mount Mount the inactive slot itself
--dry-run List what would be fetched and installed; needs no root
--root DIR Install into DIR instead of choosing a slot. Nothing after the installs runs: no kpkg check, no copy of /ports, no deploy or try
--in-place Update the running root even on an A/B machine, giving up the rollback, or on the live medium, into the overlay. On a machine with a second slot it prints --in-place: updating the running root in place, without an A/B rollback; with one slot, or on the live medium, no A/B slots — updating the running root in place
--progress FD Write one line per event to that descriptor, for a program

--progress writes these lines, each as it happens:

Line Means
refused <reason> Nothing was written; the reason is the sentence a person is shown
verified <key-id> <version> <items> <bytes> The index or manifest verified and covers every item; for --arm, verified - <version> 0 0
item <done> <total> <name> One more step of the long work
error <reason> The run failed; the slot stays untried
acquired <slot> <version> The slot is filled and checked
armed <slot> <version> The slot is the next boot’s candidate

Stopping an apply. SIGTERM stops an apply between packages, or partway through writing the slot from a slot image; it is what kdos-sysupdated’s Job.Cancel sends. A SIGINT or SIGHUP sent to the apply alone stops it the same way. The message and update.state say where it stopped:

kdos-bootctl try is the point of no return. A stop that comes once the slot is the candidate cannot be honoured, so the run says the stop came after slot <x> was armed; the update stands, exits 0, and update.state’s apply ok line adds a stop came after it was armed. A group signal that kills the try itself is judged by the boot state: if it names the slot as the candidate the run ends that way, and otherwise as cancelled.

Ctrl-C, a closed terminal and timeout -s INT signal the whole process group. During a package run the install in flight dies with them and the run ends as a failed install; while the slot is written from an image, or before anything was written, the run sees the stop and ends as cancelled with the matching message.

A stopped run unmounts the slot --mount mounted, and leaves the slot incomplete once its first byte was written, so it is never tried. An --in-place run stopped by a group signal leaves the running root with part of the package that was in flight.

When nothing is behind. Two cases arm or repair a slot without installing anything:

In both cases <version> is the version the slot records, the name System Versions and kdos-bootctl status show (0.2+<commit>-dirty for a slot of the running root’s own unnamed tree), while the progress line and update.state keep the tree’s version.

A fetched slot image the run does not take is named on the way to the binhost lane: the fetched image <version> (tree <commit>) is not newer than this machine's tree <commit>, so apply looks for packages.

fetch and apply need root and take one lock, so a tree is never replaced under an install. On an installed machine without A/B slots apply updates the running root, and a package that fails leaves the ones that installed in place. See Updating a machine and A/B slot selection.

Exit Means
0 Done, or nothing was behind
1 A download, a verification, an install or build, the slot’s check, the carry, the deploy or try failed, or the slot could not be marked as being written
2 Not attempted: no tree, no package database (the source lane), not root (without --dry-run), another update holds the lock, or a bad option
3 Refused before anything was written, with the reason on standard error and in refused: a trial boot; the inactive slot not mounted and neither --mount nor --in-place given; the live medium without --in-place; --acquire or --arm with no A/B slot, or --arm of a slot no acquire filled; packages that need a source build; an index or image that did not verify; no slot image on offer for --image, or --image with no slot to write it into; no package database in the slot (the prebuilt and image lanes); --mount could not mount the slot; or a slot that cannot take the update
4 Stopped by SIGTERM (Job.Cancel), SIGINT or SIGHUP sent to the apply, between packages or while writing the slot from an image; the slot is not booted

Install routes and groups

install puts software into the running root by a route, and /etc/kdos/update.conf names the one it takes when no flag does:

Key Values Decides
install = prebuilt (the default), source The route of the port asked for: --prebuilt or --source
build-deps = prebuilt (the default), source For a source install, whether each dependency the machine lacks is downloaded or built too: --build-deps=

Any other value is a usage error, exit 2. A prebuilt install takes the port and everything it lacks from the release’s binary host: every package file is fetched and checked against the signed index before any is installed, and each goes in through kpkg binhost under KPKG_REQUIRE_SIG. A source install fetches every source with kpkg fetch first, then builds with kpkg install under the build environment of /etc/kdos/chroot.env, so what it builds carries the build configuration the binary host’s packages carry. Its missing dependencies come prebuilt or are built per build-deps; under build-deps = prebuilt a dependency the binary host does not cover is built instead. A package built here carries no signature. --root DIR installs into a root that is not running (DIR absolute) by the prebuilt route only, because a build compiles against the root it runs in; --source with --root exits 2. That root’s package database, world set and origin file are the ones written.

Each package an install or an update adds records its route in /var/lib/kdos/origin, one <package> prebuilt|source line; a package with no line is prebuilt, which is how everything the image brought arrived. The file is carried into a slot at the arm beside the world set, and an update keeps each route: a package built here is built here again, one taken from the binary host is taken from the next release’s. The port joins /var/lib/kdos/world only after everything installed, so an install stopped half way keeps the packages that finished and their origins.

kpkg remove <pkg> takes the package out of the running root’s world and origin as well, so the next update does not bring it back. That reaches this root only. The other slot is a root of its own: once an update has filled it (apply --acquire) the package is installed there too, and once the update is armed (apply --arm) the slot also holds its own copy of world and origin, so it boots with the package installed and listed. Run kpkg remove again after booting into that slot.

Each package file the cache lacks prints ==> downloading <file> (<size>) as its download starts, and each package installed prints ==> installing <pkg> (prebuilt) or ==> installing <pkg> (built here); every download comes before the first install. A download that is cut off keeps the bytes that arrived as <file>.part in the cache and exits 1 with kdos update: <cache>/<file> was cut off at <n> of <size> bytes (curl exit <rc>); nothing was installed — run the same command again to continue the download (— pressing Install again continues the download under KDOS_UPDATE_FRONT=discover, which Discover’s ports helpers set); run again, the same command asks the server for the rest with a Range request (curl -C -) and checks the joined file against the signed index’s hash, and a server that cannot serve a range (curl exit 33) has the file downloaded whole. Only the cache’s package, delta and signature files keep a part, their names carrying their version: the binary host’s index and the software catalogue start over at each fetch, and their cut is reported as <path> could not be downloaded. kdos update apply keeps and continues its parts the same way, and its words name no command to run again, since they reach Discover’s banner. --dry-run decides everything and touches nothing, so it needs no root, and prints one line per package and a total:

<pkg> prebuilt <file> <bytes>
<pkg> source <version>-<release>
total <prebuilt-count> <bytes> <source-count>
installed <bytes>
build-space <bytes>

The installed line is the sum of the prebuilt packages’ I: sizes, 0 when the index carries none. The build-space line is printed only when something is built here. A package line’s bytes are its file’s size; the total’s bytes are what is still to download: nothing for a file the cache holds, and for one cut off only the rest its <file>.part lacks. That is what a resumed download asks for; a server that cannot serve a range, or a delta that fails and takes the part with it, sends the whole file, and a delta that applies sends less. The free-space check before the downloads measures the same remainder.

A source install first readies the machine to build, as the next section says; those packages are listed before the rest, as <pkg> prebuilt <file> <bytes> or <pkg> dev <file> <bytes>, and counted in the total. A group prints a total per member. Discover runs this dry run before it asks for the password and shows its counts (Discover).

A group is a named set of ports in the tree’s groups file (/ports/groups): a group <id> <title> line, then its member ports, any number to a line, until the next group. A member may be a meta port, such as kde-gear-games, which installs what it names. install <group> installs each member as the port it is, by the same flags, with a ==> <group>: <port> (N of M) line before each; each member the install adds joins the world set by its own name, so a member a later tree drops from the group stays installed, and a member already installed is left as it is and not recorded, so a program the base image brought is not offered for removal. A port named by itself is recorded even when it is already installed. A group install works on an installed machine and on the live medium, where it goes into the RAM overlay and is gone at the next restart. The groups the tree names are:

Group Members
kde-games, kde-education, kde-pim, kde-multimedia, kde-graphics, kde-utilities, kde-devtools The KDE Gear meta port of each
kde-network KTorrent, KRDC, Krfb, kio-gdrive, the online-account providers, Samba sharing
kde-system Filelight, Sweeper, KFind, KSystemLog, KWalletManager, KCharSelect, KHelpCenter; the base image already carries Filelight, KFind, KWalletManager and KCharSelect
kde-artwork The KDE wallpaper collection, Oxygen
office LibreOffice, calibre, TeXstudio
graphics GIMP, Krita, Inkscape, darktable, Blender
internet Thunderbird, Chromium, LibreWolf
multimedia VLC, mpv, OBS Studio, Audacity, Shotcut, HandBrake, Kodi
games SuperTuxKart, Wesnoth, Xonotic, Luanti, ScummVM, RetroArch
science Octave, QGIS, Stellarium, FreeCAD, KiCad, OpenSCAD
development Rust, Go, Node.js, Zig, GDB, Valgrind, strace, LLDB
windows Wine
build-tools GCC, binutils, make, CMake, Meson, Ninja, pkgconf, autoconf, automake, libtool, bison, flex, fortify-headers
lang-zh, lang-ja, lang-ko fcitx5’s Chinese addons, Anthy or Hangul, with fcitx5-gtk and Noto CJK

build-tools is a toolchain, not only a set of ports. Every member it adds goes in whole (KPKG_FACETS=all), and after the last member the install restores, as --dev would, the development facet of every installed member and of musl, linux and gcc that is left out: the image carries gcc under FACETS=run, which leaves out the gcc, cc and g++ drivers with the C library’s and the kernel’s headers. It prints ==> build-tools: development files of <n> packages before the restore’s own lines, and --dry-run prints the <pkg> dev <file> <bytes> lines and a total line inside the group’s plan, linux’s headers among them. Afterwards cc compiles a program that includes <stdio.h> and <linux/limits.h>. fortify-headers is a member because /etc/kdos/chroot.env compiles every port with -D_FORTIFY_SOURCE=2 -isystem /usr/include/fortify: without that directory musl’s headers ignore the macro, and a port built here would be less hardened than the binhost’s build of it under the same build-config hash.

install --pending installs every id in /var/lib/kdos/groups-pending, the groups the installer chose and could not install, by the route the flags or update.conf name; each one that installs leaves the file at once, and the file goes with the last, so a run stopped half way picks up where it stopped. With nothing recorded it prints nothing is pending. A group whose dependencies come prebuilt, named alone or from this list, takes the binhost index before its first member: one on the prebuilt route, or built from source with build-deps = prebuilt (--build-deps=prebuilt), the condition under which a single port’s install refuses without one. It fetches the index as a single port’s install does; with still none the group is refused once, before any member, with kdos update: <why>; nothing in <group> was installed (<why> such as no signed binhost index is on this machine) and the same advice line a single port’s refusal gives, and exits 1. A run fetches the index at most once: when that fetch fails, or finds no index to take because no binhost is named or none is published, every later install in the same run is refused at once for the same reason, and install --pending, when dependencies come prebuilt (the prebuilt route, or --source with build-deps = prebuilt), stops after the first group refused, prints kdos update: <ids> stay pending; run `kdos update install --pending` again once the network is up (after a failed fetch), … again once a binhost is named (when none is named) or … again once the binhost publishes an index (when the named one publishes none), naming that group and every one after it, and exits 1 with the file as it was, so an offline machine, or one with no binhost, pays one fetch and one refusal however many groups wait.

Development files

The image carries the run-time facet of each package: its /etc/kpkg.conf says FACETS=run, so headers, static libraries, CMake, pkg-config and introspection files, man sections 0, 2 and 3 and the manuals under /usr/share/doc, info and gtk-doc are left out of every install, and each package’s left-out files are listed in /var/lib/kpkg/db/.facets/<name>. Nothing is lost: each is one command away.

install --dev <port|group>... installs each named port that is installed again whole (KPKG_FACETS=all), prebuilt from the binary host, or built here again when its origin is source; a group restores every member that is installed. The package then stays whole across updates, and across a slot image: an image’s base is stripped, so after writing the slot the image lane installs again whole every package the running root keeps whole. A port that is not installed is named with the command that installs it and skipped (with --deps, below, only a group member is), one installed whole prints every file of <port> is installed, and one older than its recipe refuses until the system update. A prebuilt restore with no binary-host index on the machine refuses with the development files of <pkg> cannot be restored: there is no binhost index here — and the step check names. Each prints ==> restoring the development files of <pkg> (prebuilt); --dry-run prints <pkg> dev <file> <bytes> (or <pkg> dev-source <version>-<release>) and the total line.

install --dev --deps <port|group>... restores, besides each named port, every installed package a build against it compiles against whose development facet is left out: its declared closure, musl, linux and gcc, the set a source install restores in its step 2 below. A program built against Qt Widgets needs it: --dev qt6-qtbase alone brings back Qt’s CMake files, which then look for the OpenGL headers of libglvnd and mesa, and --dev --deps qt6-qtbase brings those back too. The closure is the recipe’s whole transitive one, limited to what is installed with its development facet left out, so it can be large: for Qt it reaches llvm and clang through mesa; --dry-run prints each dev line and the total first. With --deps a named port that is not installed is not skipped: its closure is restored alone, which is what a build of it here needs, while a group member that is not installed is still skipped. A closure already whole prints the development files of what <port> builds against are installed. --deps without --dev is a usage error, exit 2.

A source install readies the machine first, before anything is built and printing each step:

  1. It installs every member of the build-tools group that is not installed, and everything they lack at run time, prebuilt whatever --build-deps says (==> installing <pkg> (prebuilt, for building)); each package it installs records prebuilt in /var/lib/kdos/origin, and each member joins the world set. Their dependencies are cut by the index’s N: lines as in any prebuilt install, so the tools’ own build-only ports (Sphinx, the Python build backends, Muon, scdoc) stay out. With no binary-host index on the machine it refuses with <pkg> of the build tools cannot be installed prebuilt: no binhost index here — and the step check names. A tree with no build-tools group stands for it with gcc, binutils, make, cmake, meson, ninja, pkgconf and fortify-headers (the /usr/include/fortify every build’s flags include).
  2. It installs, prebuilt, each port of /ports/buildheaders that is not installed and that a package of a built port’s declared closure names, when that package is installed or the run installs it prebuilt (as a build tool, a dependency or what another header port needs): the build-only ports whose headers other packages’ headers include, as libX11’s include xorgproto’s (Building here). Each header port it installs joins the world set and records prebuilt in /var/lib/kdos/origin, and so does each package it lacks at run time without joining the world set unless that package is a header port too; a header port that a build tool or a dependency brings joins it the same way, so removable lists the header port and remove takes it with what only it brought. One the index does not cover refuses the install with <pkg>, whose headers <m>'s headers include, cannot be installed prebuilt: <reason>, the stanza test that failed, or <dep>, which <pkg> needs (<m>'s headers include <pkg>'s), … for what the header port needs at run time.
  3. It restores the development facet of every installed package the build compiles against — the declared closure of each port it builds, musl, linux and the build tools — as --dev would. A package the binary host does not cover, or one older than its recipe, refuses the install before anything is fetched.

Every package such a run installs goes in whole, so what a later build in the run compiles against is complete. The same three steps run before the source items of apply, in the slot. kpkg install run by hand refuses to build against a package without its development files and names the sudo kdos update install --dev <pkg> that restores it.

kdos image

kdos image make ROOT OUTDIR --version V [--tree C] [--time T] [--key FILE]
                [--prev DIR [--prev-root DIR]]... [--exclude PATH]... [--level N] [--part-mb N]
kdos image verify DIR [--keys DIR]
kdos image unpack DIR|URL TARGET [--seed ROOT] [--keys DIR]
kdos image carry RUNNING SLOT [--root-dev UUID=…]

A whole root slot as one signed release, and its deltas from earlier ones. One file of kdos-tools holds both halves, the release step that makes an image and the machine that writes one into its inactive slot, so the format has one reader and one writer. The format and why a slot is not one patch are in Slot images.

Verb Does
make Writes a signed image of ROOT into OUTDIR: the manifest (every directory, file, link and hard link with its mode, owner, time, size and SHA-256), the full bundle of objects cut into parts small enough for a release asset, for each --prev image a delta bundle holding what that version lacks, whole or as a zstd --patch-from difference, plus every object under etc/ and var/, and kdos-update.idx, the release index naming each of those files at image/<name>, signed with the same key
verify Checks the manifest’s signature against /etc/kdos/keys (or --keys) and every object the manifest names, in a local directory; a URL is a usage error
unpack Reads the release index at DIR or URL first and takes the manifest and every bundle where it says; writes an image into TARGET, synchronising rather than formatting: a file the target already holds with the right hash stays, one the seed root (--seed, the running root) holds is copied, and only the rest comes from a bundle. Entries the manifest does not name are removed, except lost+found and anything on another filesystem. The slot keeps its filesystem and its UUID
carry Copies a running root’s configuration and state into a slot, which is what kdos update apply --arm does before a slot is tried; --root-dev names the slot’s own root device for its fstab

make stamps the image with the commit, time and version in ROOT/ports/TREE unless --tree, --time or --version names them, and refuses a version it cannot use. --level is the zstd level of the bundles, 1 to 19 (default 12), and --part-mb the size a bundle is cut at (default 1900 MiB); --exclude leaves a path out of the image.

Nothing in a bundle is trusted: every object, whole or patched, is hashed after it is written and kept only when the hash is the one the signed manifest gives, so a tampered bundle costs a download and never a file.

The owners are checked as well as the bytes. make refuses a root whose ., top-level entries and everything under etc/, usr/, boot/ and ports/ do not share the root directory’s owner, and, run as root, one where that owner is not uid 0, because a slot written from it would give those files to whatever account has the builder’s uid. verify refuses such a manifest with exit 3, and a slot fill run as root refuses it too.

carry keeps a slot’s own copy of a configuration file the running root has changed as <file>.kdos-new beside it, or as .<file>.kdos-new inside a *.d directory, where a program reading every file of the directory would otherwise take the second copy as configuration. It also makes every absolute mount point the slot’s /etc/fstab names that is missing (mode 0755, without following a symbolic link), so a slot written from an image mounts /boot/efi like the one it replaces.

Exit Means
0 Done
1 A write, a copy or a carry failed
2 Bad usage
3 The release index or the manifest did not verify, the manifest is not the file or the version the index names, the image is for another architecture, or its owners are mixed

kdos firmware

kdos firmware sync [--root DIR] [--dry-run [--json]] [--all]

The vendor firmware this machine’s hardware asks for and has not got, installed prebuilt. Upstream’s linux-firmware is split into eight packages, and the installation medium carries Intel’s, AMD’s, MediaTek’s and Realtek’s (see The base image); this is how the rest reach a machine that needs them.

It looks in two places. Every device under /sys/bus/<bus>/devices/ by its modalias: the module bound to it, and every module modules.alias (or, for a driver built into the kernel, modules.builtin.modinfo) says would bind it, each module’s firmware: lines read with modinfo -F firmware. And the kernel log, /dev/kmsg: each Direct firmware load for <path> failed and firmware: failed to load <path> line. A file present under <root>/lib/firmware, as itself, .zst or .xz, or under lib/firmware/updates, is satisfied; any other is looked up in /usr/share/kdos/firmware-map, which the firmware-map port builds from the same tarball and the same rule as the vendor ports, one <port> <path> line per file and link. A mapped file whose port is not installed names that port. A driver’s list covers every chip it supports, so a driver names its vendor’s whole port; module dependencies are not followed, so btusb does not name the four vendors whose Bluetooth helpers it loads, and the adapter’s own failed request in the kernel log names its port instead. A path the kernel asked for that no port ships is reported on standard error and never guessed at, and so is a path that climbs out of /lib/firmware.

Option Does
--dry-run Prints one <port> <reason> line per port, sorted, and installs nothing; needs no root. The reason is the first evidence found, the kernel log first: the kernel could not load ath11k/WCN6855/hw2.0/amss.bin or module nouveau, pci 0000:01:00.0
--json With --dry-run: {"ports":[{"port","reason"}],"unshipped":[paths],"kernel_log":bool,"modules":bool}, which kdos-notice reads; kernel_log is false where the log could not be read
--all Every vendor port the map names that DIR has not got, whatever the hardware
--root DIR Checks and installs into the root at DIR, which must be absolute: its /lib/firmware, its package database, and its firmware map, or this system’s when DIR has none. The devices and the kernel modules are this machine’s. What the installer runs into the new disk

Without --dry-run it runs kdos update fetch --binhost-only, and then kdos update install --prebuilt [--root DIR] <port> once per port, each as an argument vector, so every port takes the signed prebuilt route, the origin record and the world set any other install does (see Install routes and groups). A failed fetch is reported and the installs go ahead from the index cached here. kernel.dmesg_restrict keeps the kernel log from a user, so a dry run without root decides from the devices alone and says so on standard error.

Exit Means
0 Nothing to install, or every install succeeded
1 A dry run that names a port; an install that failed (the port is named); a sync without root
2 Bad usage: an unknown option, --json without --dry-run, a relative --root
3 No firmware map in DIR or on this system, so nothing could be decided

$KDOS_FIRMWARE_SYSROOT moves /sys, /lib/modules and /dev/kmsg and $KDOS_FIRMWARE_KVER names the kernel release, for the self-test’s fixture; modinfo is found on $PATH.

kdos timezone, hostname, locale, keymap and in-vm

kdos timezone [Area/City]       # print, or set, the time zone
kdos hostname [name]            # print, or set, the static host name
kdos locale [NAME=value...]     # print, or replace, the locale settings
kdos keymap [map]               # print, or set, the console keymap
kdos in-vm                      # exit 0 inside a virtual machine

The machine’s name, clock and language, through the same services System Settings uses: timedate1, hostname1 and locale1, which kdos-settingsd serves and writes to the files KDOS reads. With no argument each prints the value in force. Setting one asks polkit with interaction allowed, so a person outside wheel is asked for a password by the polkit agent rather than refused outright, and the time zone needs none in the active session. locale replaces the whole list: every NAME=value given, and nothing else. Each value must be C, C.UTF-8, POSIX or ll[_CC][.UTF-8|.utf8][@modifier] whose language ll has a musl-locales definition or translations under /usr/share/locale, and each element of LANGUAGE the same without a codeset, or C, because SDDM hands the file to every session. The territory is not checked: ja_JP.UTF-8, which plasma-setup’s language page sends, is taken although locale -a does not list it, and selects Japanese translations and formats in KDE programs. A person’s own formats on System Settings → Region & Language are not limited by this rule. in-vm prints nothing and exits 0 inside a virtual machine and 1 otherwise.

Exit 0 done, 1 when the service refused or did not answer (its message is printed: InvalidArgs means the zone, name or map is not one, or the locale names a language this system does not know), 2 on bad usage.

kdos backup

kdos backup run

One restic snapshot, as ~/.config/kdos/backup.conf says: what the nightly timer runs, and what a person runs at a prompt. Kup, in System Settings, is the backup a person sets up with the mouse; this is the one written in a file, and both may share one repository. Every snapshot made here is tagged kdos, and Kup’s own prune forgets only the snapshots tagged kup, so neither ever removes the other’s.

The file is parsed, never sourced: key = value a line, # to the end of a line a comment.

Key Means
repo The restic repository; the last one wins
password-file Where the repository’s password is; default ~/.config/kdos/backup.pass; the last one wins
include A path to back up; up to eight
exclude A restic pattern to leave out, passed as written, globs and all; up to eight

The password is a file and never an argument, and a file anyone else can read is refused before restic is started: group or world readable is the same disclosure as an argument, by a slower route. Each include and exclude is one argument, so a folder with a space in its name is one folder.

The timer row is ~/.config/kdos/timers.d/10-backup.timer, shipped commented out, because a backup nobody asked for is a surprise and the first run over a home can take hours. Uncomment it once the configuration names a repository and the password file is mode 0600; it runs at 03:40 under your own user services, and once on waking when the machine slept through it, within eight hours.

The exit status is restic’s (3 an incomplete snapshot, 10 no repository, 11 locked, 12 a wrong password), or 1 for a refusal here, 2 for bad usage, 127 with no restic.

kdos checklist

kdos checklist --json        # {"version":1,"items":[{id,done,dismissed}…]}
kdos checklist dismiss <id>  # hide one item for good
kdos checklist restore       # bring every hidden one back

The first-run checklist the tray’s Getting Started applet shows (see Getting Started). Each item is done when the machine says so, never when a box was ticked:

Item Done when
backup ~/.config/kdos/backup.conf names a repository and something to put in it, or Kup is on with a restic plan that has a destination
phone KDE Connect has a paired device
language Formats were set, or a second keyboard layout added. A [Formats] LANG equal to /etc/locale.conf’s (a C locale when that names none) is not a choice, since Plasma writes the session’s LANG there at every account’s first login; any other Formats key, or a LANG that differs, is
box A box exists
firmware fwupd has no update waiting
encryption The root filesystem sits on LUKS

An item whose component is absent is left out rather than shown undone: a phone item on a machine with no KDE Connect is a task nobody can finish, and so is encryption on a root that is not a block device, such as the live medium’s overlay. The tray asks every five seconds while anything is open, so fwupd’s answer is remembered for six hours and the root device’s for the boot. Exit 0; 1 a failure, with one line a person can read; 2 on bad usage.

kdos march

kdos march [probe]           # which x86-64 levels this processor supports (the default verb)
kdos march run <port>...     # build each port twice and measure
kdos march report            # the ledger
kdos march decide <baseline> <optimised> <noise%>
$ kdos march run lz4
lz4                      x86-64-v3  baseline 0.321s  -march=x86-64-v3 0.302s  +5.9% (noise 16.7%) -> reverted
                           the win is inside the noise; that is not a win
                           this machine's noise floor is 16.7% — close things down or raise KDOS_MARCH_RUNS

Asks whether building a port for this processor’s instruction-set level (-march=x86-64-v2, -v3 or -v4) makes it faster here. probe reads /proc/cpuinfo for the flags each level needs. run builds the port twice on this machine with kpkgbuild, run directly in the port’s directory with CFLAGS, CXXFLAGS and PACKAGE_DIR in its environment and no shell between, once with the CFLAGS of its own environment (-O2 -pipe when CFLAGS is unset; CXXFLAGS gets the same value) and once with -march=<level> appended, unpacks both, runs the port’s own benchmark against each, and records the verdict kept only when the win is more than 3% plus the noise measured on this machine (with 8% noise, a win must exceed 11%). Nothing is installed; the verdicts go to a ledger.

The rules:

run with no port exits 2 (name at least one port) and does no work. A processor with no level above baseline x86-64 has nothing to measure and run exits 1. A verdict the ledger cannot take is said on standard error, <port> not recorded — cannot write <path>, because report reads only the ledger.

Variable Default Effect
KDOS_MARCH_RUNS 5 Timed runs per build, from 3 to 31, rounded up to an odd number
KDOS_MARCH_LEVEL the highest level probe finds The level to measure against
KDOS_MARCH_LEDGER /var/lib/kdos/march.ledger Where verdicts are recorded

report prints the ledger (kept, reverted, unmeasurable and unbuildable) with a summary line, and exits 1 when nothing has been measured. The reverts are listed as prominently as the wins, because they are the evidence the measuring is real. decide applies the decision rule to three numbers and exits 0 for kept, 1 otherwise; it exists for testing.

The argument for measuring per machine rather than choosing a tier is in Decisions.

kdos rebuild

sudo kdos rebuild [--dry-run] [--iso-only] <work-dir>

Runs the KDOS build from a booted KDOS medium, with no network at any point. It rests on three properties of the tree: the repository builds offline once make fetch has placed every source archive and vendor bundle in ports/, the shipped system carries the compilers and kpkg, and packages are reproducible, so the result can be compared with what it was built from.

The sources are looked for in $KDOS_SOURCES, then /mnt/iso/sources, /kdos and the current directory; a directory counts when it has script/kdosbuild.sh, ports/core, fs/etc and src/devtools/kdosbuild. The work directory is the one argument, and before anything is copied the command refuses when:

It then copies the tree to <work-dir>/kdos (a second run with the same work directory reuses the copy), compiles the build orchestrator kdosbuild from that copy into <work-dir>/kdosbuild, and runs it with --fresh. That is the same orchestrator make build runs, reading the same phase scripts. The job count is KDOS_JOBS when the caller sets it; otherwise the build environment computes it from this machine, one job per thread but no more than one per 2 GiB of memory, so a laptop with little memory builds slower rather than having its compilers killed. --iso-only runs only the 70_image phase. --dry-run stops after the checks and prints the plan.

The build runs as root. It sets owners on the files of the tree it assembles, and most phases run their steps inside a chroot whose entry script, script/chroot/exec.sh, exits at once for any other user. kdos rebuild therefore refuses to run (exit 1) unless it is root, before it copies anything; --dry-run is the exception, and checks and prints the plan as any user. sudo resets the environment, so KDOS_JOBS and KDOS_SOURCES reach the build only when they are passed through it, as in sudo env KDOS_JOBS=4 kdos rebuild /mnt/disk/work. How KDOS is built follows the same build from git clone to an ISO, and The build system describes the orchestrator.

A developer medium, one that carries the sources, is made and used in four steps:

  1. On a build machine, in a checkout of the repository, run make fetch and then make build KDOS_ISO_SOURCES=1.
  2. Write the ISO to a USB stick and boot it.
  3. Mount a real disk with at least 25 GB free (not tmpfs and not an overlay), for example at /mnt/disk.
  4. Run sudo kdos rebuild /mnt/disk/work.

KDOS_ISO_SOURCES=1 makes script/phases/70_image/110_iso.sh copy ports/, src/, script/ and fs/ onto the medium’s ISO 9660 filesystem beside the system image, under /sources, together with the top-level Makefile, Dockerfile and CLAUDE.md (the repository’s briefing for contributors) when the build can see them, and with the binary host at /sources/binhost when the same build wrote one (KDOS_MAKE_BINHOST=1). The sources cost the installed system nothing and are readable at /mnt/iso/sources as soon as the live system is up. The option is off by default because a medium that carried ports/ would roughly double in size: ports/ is about 40 GiB of archives that are already compressed (du -sh ports/core with every source fetched). The fetch cache ports/.srccache is left off, because each port directory already holds its own copy of the bytes. A SOURCES stamp records the port count, size and build time, and kdos rebuild prints it before it starts; the port count is the number of recipes in the medium’s own ports/core, found at <name>/ or one shelf down.

Inside the chroot, /kdos is a non-recursive bind of the build container’s /workspace, and script/chroot/exec.sh binds script/, src/, fs/, the Makefile and the Dockerfile back over it and binds ports/ at /ports; the step reads each from there. The build container mounts the Makefile and the Dockerfile beside the directories, and not CLAUDE.md, so a medium made by make build carries the first two and not the third. kdos rebuild names its copy of the tree in KDOS_WORKSPACE, and the host environment (script/env/host.env) takes WORKSPACE from that variable, so the bootstrap phase’s file-system step copies the overlay from the copy’s fs/ rather than from /workspace/fs. No rebuild from a medium has been run through every phase; see Known gaps.

kdos persist

kdos persist [--json]                                  # report
sudo kdos persist create [<device>] [--yes]            # -y also works
sudo kdos persist reset [--home | --system] [--yes]    # from the clean session
$ kdos persist
no persistence store

  This session's writes are in RAM and go when it is
  powered off.
  `kdos persist create` makes a store in the free
  space after the image on the boot medium.

$ sudo kdos persist create
  disk       /dev/sda  (32G)
  partitions 3 now; the store is added after the last
  filesystem ext4, labelled KDOS_PERSIST

On the live medium, everything you write goes into the upper layer of an overlay held in RAM, and is lost at power-off. create gives that upper layer a real filesystem instead: one ext4 partition with no reserved blocks, labelled KDOS_PERSIST, made in the free space after the last partition of the boot medium or of the disk you name. A disk with no partition table is given a GPT holding only the store. It asks you to type yes unless given --yes, and it must run as root with sfdisk, mkfs.ext4, blkid and losetup installed.

With no store, the report’s last lines depend on what the session started from. From a written stick it offers the free space after the image on that stick, as above. From a disc it says the boot medium (/dev/sr0) is a disc and cannot hold a store, and from a Ventoy stick that a Ventoy stick cannot take a KDOS store; both name sudo kdos persist create /dev/sdX for another USB stick or disk. Each of these first says the session’s writes are in RAM. An installed system, which started from no medium, prints only that it did not start from a live medium and that sudo kdos persist create /dev/sdX puts a store on the device named.

create refuses, before it writes anything, when a store already exists, when no device is named and the system did not boot from a medium, when the device is a partition rather than a disk (it names the disk), when the device is read-only (an optical boot’s /dev/sr0), when it is a Ventoy stick (the /dev/mapper/ventoy mapping a Ventoy boot runs from, which has no partition table of its own, the stick partition node a BIOS boot mounts it through, or the physical stick whose partition holds that mapping) or another device-mapper device, a device being known by the number its node opens rather than by the node’s name, and when the whole disk is one filesystem with no partition table (it names the type, because there is no free space to take). When sfdisk will not add the partition, its own error is printed.

--json prints the report as one line for a settings page:

Key Holds
live Whether a boot medium is mounted at /mnt/iso
store none, present, refused or in-use
device The store’s partition, or null
type The store’s filesystem type, or null
medium The boot medium’s disk, or null
kind What the boot medium is: stick; disc for any read-only medium, a write-protected stick among them; ventoy; or mapped for another device-mapper disk; null with no medium
writable Whether the boot medium can hold a store; false for every kind but stick
candidates The disks a store could be made on: the medium when it is writable, then each removable or USB disk that is writable, has nothing mounted and is not a Ventoy stick

The welcome tour’s live page reads it, offers the candidates, and runs pkexec kdos persist create --yes for the medium or pkexec kdos persist create /dev/<name> --yes for another disk, which the live medium’s polkit rule grants the session without a password.

The label is the whole interface. At boot the initramfs asks blkid for a filesystem with that label and uses whichever answers, so the store can live on the boot stick, on a second stick or on an internal disk. No path is written into any configuration file, because device names depend on enumeration order and USB does not keep it. When more than one filesystem carries the label, the report lists them all: the boot takes the one blkid answers first, which can change between boots.

The store must be a filesystem with extended attributes, hard links and d_type, which is why create makes ext4. FAT and exFAT labels hold at most 11 characters, so neither can carry the 12-character KDOS_PERSIST and such a store is never found. The initramfs refuses an ntfs, iso9660 or squashfs store by name and says so on the console, because overlayfs rejects an unsuitable upper layer with the same EINVAL it gives for every bad mount; kdos persist reports such a store as refused with its type, and --json gives "store": "refused". A store that is refused or will not mount costs nothing but itself: the session comes up in RAM as it would with no store. The boot side is in Boot and init.

Three behaviours of the store are easy to miss:

create appends a partition with sfdisk --append and never rewrites the partition table, because the existing entries describe the image the machine is running from; --wipe never keeps sfdisk off the ISO 9660 signature at the start of the disk. The medium is mounted as the whole disk, because ISO 9660 starts at its first sector, and a mounted disk is held exclusively: the kernel refuses to re-read its table and refuses to open any partition on it for mkfs or mount. So create passes --no-reread, registers the new partition with partx -a, and makes the filesystem through a loop device over the disk at the partition’s offset and length, which opens the disk without that claim. reset mounts a store on the boot disk the same way, and so does the initramfs; a store on any other disk is opened directly.

kdos clone

kdos clone                          # list what may be written to
sudo kdos clone /dev/sdb
$ kdos clone
source  /dev/sda  9.5G

  DEVICE            SIZE  MODEL
  /dev/sdb          32G   Ultra Fit
  /dev/sdc         8.0G   DataTraveler   (too small)

Copies the medium this system booted from onto another device and verifies the copy. It is a raw copy of the image, so the copy boots exactly what the original boots. The source is the device mounted at /mnt/iso; an installed system has none, so give one with --source. The listing offers only removable or USB disks that pass the refusals below, marking any that is too small.

Flag Does
-y, --yes Skip the confirmation, which is otherwise typing the device name; with no terminal and no -y, the clone is refused
--no-probe Skip the counterfeit-device probe, saying what was given up
--no-verify Skip the read-back, saying what was given up
--extent Print the image’s exact byte count and stop
--source <path> An image file or device to clone instead

A small image written to a large stick leaves the device reporting the large size, so copying the whole device would copy whatever was on it before. The length comes from two records inside the image, and the larger wins:

Record Covers a partition appended after the ISO 9660 volume?
The ISO 9660 primary volume descriptor’s volume size No
The GPT header’s alternate_lba, the position of the backup header Yes

The KDOS image needs only the first. Its ISO 9660 volume spans the whole file: the EFI system partition is an El Torito boot image inside the volume, which the MBR also names as partition 2, and the image carries no GPT. The second record is for a hybrid image made with an appended EFI system partition, where the volume descriptor stops short by the size of that partition and those bytes are what make the copy boot. An image with neither record is refused as not a KDOS medium.

Four refusals stand before a byte is written. A clone never writes to the medium this system booted from, to a disk with a filesystem mounted anywhere, to a disk named by device path in /etc/fstab, or to anything smaller than the image. Each is checked against the whole disk, because the target is a whole disk while everything identifying the running system names a partition. These rules are wider than a mounter needs: a mounter chooses something to mount, and this chooses something to destroy.

A counterfeit stick reports a capacity it does not have and silently wraps writes around, so the copy appears to succeed and the verify fails in the middle, which looks like a broken image. When f3probe is installed it runs first in destructive mode (the device is about to be overwritten anyway), and a counterfeit or damaged verdict refuses the clone. The probe writes and reads back across the whole device and takes minutes; its output is shown as it arrives, with an elapsed-time line between its lines on a terminal, and --no-probe skips it.

Before the read-back, the block device’s cache is dropped (BLKFLSBUF). Otherwise the read would return the bytes this process just wrote rather than the bytes the flash stored, which is exactly what a counterfeit stick would get away with. The written and read-back SHA-256 hashes are compared, and a failed verify prints both.

kdos speech

kdos speech transcribe [--notify] [--] FILE...   # a .txt beside each file
kdos speech say [--voice NAME] [--] [TEXT...]    # read TEXT, or standard input, aloud
kdos speech sync                                 # Klipper's Read Aloud action
kdos speech list              # the transcription models, and which are here
kdos speech get [NAME]        # fetch one; base.en when no name is given
kdos speech where             # the directories searched, and the models in each
kdos speech remove NAME
kdos speech voice list        # the Piper voices, and which are here
kdos speech voice get [NAME]  # fetch one; en_US-lessac-medium when no name is given
kdos speech voice remove NAME

Transcription and reading aloud, on this machine: whisper.cpp hears and Piper speaks, each from a model file on the disk, and nothing is sent anywhere. Dolphin’s Transcribe action runs transcribe (see Transcribe), and Klipper’s Read Aloud action runs say.

None of the programs or models is on the image. Each is a port:

sudo kdos update install whisper.cpp             # whisper-cli, for get and transcribe
sudo kdos update install whisper-model-base-en   # base.en in /usr/share/whisper.cpp/models
sudo kdos update install piper                   # for voice get and say

get and transcribe need whisper-cli, and voice get and say need piper. A verb whose program is missing prints kdos speech: <port> is not installed — sudo kdos update install <port> and exits 1, before anything is downloaded; get reports an unknown model name first. A transcribe --notify with no whisper.cpp raises Transcription failed / whisper.cpp is not installed too.

transcribe decodes each file with ffmpeg to the 16 kHz mono audio whisper reads, into a private file in the runtime directory removed on every path out, and writes the text beside the file as FILE.txt, or FILE.2.txt and onward, never over a text you already have. The model is $KDOS_WHISPER_MODEL, else the largest catalogue model in your directory, else the largest in the image’s. --notify says when each is done.

say speaks with a Piper voice, <name>.onnx with its <name>.onnx.json beside it, from ~/.local/share/piper/voices and then /usr/share/piper/voices; --voice names one. sync keeps Klipper’s Read Aloud action in step: it is there exactly while piper and a voice are both installed, and is removed, exactly that action, when either goes, saying which (piper is not installed or no voice is installed), through kwriteconfig6 on klipperrc. The autostart entry kdos-speech-sync.desktop runs it at every login, and voice get and voice remove run it when they finish.

A voice is one language and one speaker, so it is fetched like a transcription model. voice get fetches the .onnx and its .onnx.json from Piper’s voice repository at its v1.0.0 tag into ~/.local/share/piper/voices, checks each against a SHA-256 recorded in the source, and renames both into place only when both match. say and Read Aloud find a voice only while its .onnx.json is beside it, so a half-fetched voice is never used. voice list marks a voice in your directory installed.

Voice Size
en_US-lessac-medium (the default) 63 MB
en_GB-alan-medium 63 MB
de_DE-thorsten-medium 63 MB
es_ES-davefx-medium 63 MB
fr_FR-siwis-medium 63 MB

The whisper-model-base-en port puts one model, base.en, in /usr/share/whisper.cpp/models. The others range from 32 MB to 3.1 GB, and language and size are a personal choice, so they are fetched rather than packaged. list marks a model in your own directory installed and one in /usr/share packaged, and voice list marks voices the same way; where prints your directory, then /usr/share/whisper.cpp/models, each followed by the models in it. With no model anywhere, transcribe names both kdos speech get base.en and sudo kdos update install whisper-model-base-en.

Model Size
tiny.en-q5_1 32 MB
base.en-q5_1 60 MB
tiny.en, tiny 78 MB
base.en (the default), base 148 MB
small.en-q5_1 190 MB
small.en, small 488 MB
medium.en 1.5 GB
large-v3-turbo 1.6 GB
large-v3 3.1 GB

A .en model is English-only and better at English than the multilingual model of the same size. The q5_1 models are about 40% of the size of the full model for a difference most people cannot hear.

Models go into $XDG_DATA_HOME/whisper.cpp/models as ggml-<name>.bin, which needs no privilege. Each download is fetched with curl from the upstream model repository and checked against a SHA-256 recorded in the source and against the ggml magic number, and refused if either fails. A model already present is not fetched again. Upstream serves the files over TLS and signs nothing, so the checksum guarantees the bytes are the ones this release was written against; it does not make the upstream trustworthy (see the security model). A name is looked up in the table and never pasted into a URL, so a name cannot point the download at another host. An unknown verb exits 2, as every usage error does; a failed download, a checksum that does not match or a name not in the table exits 1.


The other names on this binary

kdos is one of twelve names of a single program, built by the kdos-tools package from src/system/kdos-tools/ and installed as /usr/sbin/ksvc with symbolic links for the rest. It chooses what to do from the name it was started under, the same technique kdos-appbox uses for its application shims: one binary and no shell wrapper anywhere in the chain. Started under a name it does not know (such as kdos-tools, the file the build produces), the first argument selects the tool, so kdos-tools service list works before the links exist.

Name Installed at Is
ksvc /usr/sbin The service supervisor
service /usr/sbin The same, under the conventional name
kdos-getty /usr/local/sbin Loads the console font and palette, then runs a getty
kdos-bootctl /usr/bin The A/B slot tool
kdos /usr/local/bin This chapter
kdos-shot /usr/local/bin Screenshots through Spectacle
kdos-banner /usr/local/bin The login banner
kdos-fetch-app /usr/local/bin Install an application into a distrobox with its package manager and export it to the host
kdos-fetch-static /usr/local/bin Fetch a single verified static binary
kdos-sfx /usr/local/bin The machine’s sounds
kdos-mpctl /usr/local/bin Music control, and the bridge that puts mpd on MPRIS
kdos-share /usr/local/bin kdos share, under the name KRunner’s routes and mc run

The package also installs:

kdos-doc is its own port, src/system/kdos-doc.

ksvc and service

service [--user] list
service [--user] status|start|stop|restart <name>
service [--user] enable|disable <name>

Services are the executable scripts /etc/init.d/NN_<name>.sh, and a service’s name is the script’s name without the number and the .sh. A name matches a script exactly first, then as a substring, so service start ssh finds 70_sshd.sh. list prints one line per service: its name, whether it starts at boot, and the first line the script’s status printed. A script that printed more lines gets (+N more) after it, and service status <name> prints them all; one that printed nothing gets —. On a terminal a line too long for the width is cut at its last space that keeps at least half of it, or at a character when there is none, and ends in …, so that each service is one row; the (+N more) tail is dropped when it would take more than half the room. lvm’s line reads lvm: <A> of <N> logical volumes active, and tlp’s tlp: <state>, profile <profile>, power source <source>; run as an ordinary user they say lvm: needs root to list volumes and tlp: Error: missing root privilege. restart runs the script’s stop, waits a second and runs its start.

disable creates /etc/service.disabled/<name> and enable removes it; the boot scripts skip a service with that marker (see Configuration). The marker is named after the argument exactly as typed, while the boot scripts look for the script’s own name, so give enable and disable the full name service list prints; service <Tab> offers the verbs, and service start <Tab> (or any verb that takes a name) those full names, from its completion file. A name that is not a plain name (letters, digits, _, - and ., at most 64 characters) is refused, because a name placed into a file pattern could match anything.

Your own services. --user works on a second table: the scripts in /etc/kdos/user-services (the session bus, PipeWire, WirePlumber, pipewire-pulse, mpd, your timers and your boxes), which turnstile’s ksvc backend starts at your first login and stops at your last, with their pid, state and log files in $XDG_RUNTIME_DIR/ksvc instead of /run. enable and disable then decide whether one starts. Root always gets the system table and refuses --user, because a path a root tool took from its caller’s environment would let that caller name the pid file the next stop kills. Anyone else reads the system table (service list, service status, ksvc check sshd) and gets the same states root sees, because the check reads the pid file, the state file and /proc and needs no permission to signal a root supervisor; they supervise only into their own table, whose run directory must be theirs and writable by nobody else.

The init scripts start their daemons through ksvc supervise:

ksvc supervise [--final-exit CODE]... [--facility NAME]
               [--stop-grace SECS] [--restart-with NAME]
               <name> <command> [args...]

It forks a supervisor, writes the supervisor’s process id to /run/kdos-svc.<name>.pid, and runs the daemon under it. The kdos-svc. prefix is what keeps the file the supervisor’s: /run/<name>.pid is where most daemons write their own pid, and one that overwrote the supervisor’s id would make status say [DOWN], stop drop the file as stale and stop nothing, and start run a second copy. When /run/kdos-svc.<name>.pid already names a live supervisor of that name, it starts nothing, prints [SKIP] <name>: already supervised (pid N) and exits 0, so service start on a running service changes nothing. A second supervisor would overwrite the pid file, and the first, with its daemon, could then never be stopped; a second system bus would also take the socket from the clients already connected to the first. A daemon whose supervisor is gone (one ended by SIGKILL) counts as running too: supervise waits for it to exit for at most the stop grace, then prints [FAIL] <name>: daemon pid N of a supervisor that is gone is still running and exits 1, and ksvc stop-supervised <name> ends it. A live pid alone does not make a service running: the supervisor must also run as the table’s owner, because another account’s supervisor of a service with the same name (every user has a pipewire) is not this one. The daemon’s output and the supervisor’s own start and exit lines go to the system log under the service’s name, one info message per line, and to /run/kdos-svc.<name>.log, which holds at most 64 KiB with one previous generation beside it as .old. The file is what is left before the system logger is up and while it restarts.

The messages go under the daemon facility, so to /var/log/messages, unless --facility names another: auth, authpriv, daemon, user or local0 to local7. 41_polkitd.sh passes --facility authpriv, so that what polkitd prints lands in /var/log/auth.log with what it sends to syslog itself.

The supervisor restarts the daemon five seconds after any exit. The exception is an exit status named by --final-exit (up to eight): a status restarting cannot change, such as thermald on an Intel model it does not know, smartd with no disk to watch, or a bus daemon whose name another process owns. The supervisor then says so once, removes its pid file and exits, instead of restarting the daemon every five seconds for as long as the machine is up. A death by signal is always restarted.

--restart-with NAME ties the daemon to the daemon of another supervised service. The supervisor looks at that service’s state file four times a second, and when its daemon differs from the one that was running when this daemon started (it exited, was restarted, or the service was stopped), prints [KDOS] (<name>) NAME restarted or stopped: restarting <name>, sends this daemon SIGTERM (SIGKILL after the stop grace) and starts it again: at once when the other service has no supervisor, otherwise when its daemon is back, and one second later, the time a bus that has just started needs to open its socket. Before every start, a supervisor of NAME that is between two runs of its daemon is waited for. Such a restart is not a failure and does not wait the five seconds. --restart-with dbus is passed by the scripts of the daemons that own a name on the system bus and do not exit when the bus goes: elogind, NetworkManager, kdos-settingsd, accounts-daemon, kdos-sysupdated, iio-sensor-proxy and tlp-pd. Without it, a restarted bus leaves such a daemon running with no name on the new bus while check reports [ OK ]. 45_mdns.sh passes --restart-with avahi-daemon the same way, so kdos-mdnsd is restarted with Avahi and held while Avahi is between two runs.

The supervisor runs in its own session and process group, so ksvc stop-supervised (what a script’s stop calls) signals the supervisor, the daemon and the log forwarder together. A SIGTERM sent to the supervisor alone is passed on to the group, and to a daemon that left the group by its pid, before the supervisor exits, so the daemon goes with it. stop-supervised creates /run/kdos-svc.<name>.stopping for as long as it runs, and a supervisor that finds it passes nothing on, so the daemon gets one SIGTERM, not two: llama-server, for one, takes a second as “exit at once”. stop-supervised sends SIGTERM, then waits for every process in the group to exit, checking every 50 ms, for at most the stop grace: five seconds, or what --stop-grace (1 to 600) named. Whatever is still running then gets SIGKILL, after the line [KDOS] (<name>) Still running after Ns, killing. A daemon that exits at once is stopped at once, and one whose clean shutdown takes longer names a longer grace: 76_postgresql passes 30, 83_samba 15 and 65_turnstiled 60, every user’s services within it. A daemon that moved itself into a process group of its own is signalled by its pid as well. A supervisor that did not lead its own group would be killed alone, orphaning the daemon while reporting success. The forwarder ignores the group’s SIGTERM and leaves when the daemon closes its output, so a stopping daemon’s last lines still reach the log.

The pid file names the supervisor, which outlives every exit of its daemon, so the supervisor also keeps /run/kdos-svc.<name>.state: whether the daemon is running or waiting to be restarted, its pid, since when, how many failing exits it has had in a row, the last exit status and the stop grace. A non-zero exit is a failure, and starts the count again at one after a run of 60 seconds or more. An exit with status 0 is a failure only after a run shorter than five seconds, a daemon giving up at once (ModemManager exits 0 when its bus name is taken); after a longer run it is a clean exit and clears the count, because a periodic job’s snooze exits 0 after every job it runs. ksvc check <name> prints one of these lines, and exits 0 for [ OK ] and 1 for the rest:

Line When
[ OK ] <name> (pid N) The supervisor is alive, and its daemon is running, exited 0, or is being restarted with the service --restart-with names
[FAIL] <name> (exited with code N; restarting) The supervisor is waiting five seconds to start the daemon again after a non-zero exit, or after its second failing exit in a row of any status; M failed starts in a row is added once there are two or more
[FAIL] <name> (crash loop: M failed starts in a row, last exit code N; pid P) The daemon is running again after two or more failing exits in a row, and has not yet run 60 seconds
[FAIL] <name> (supervisor gone; daemon pid N still running) The supervisor named by the pid file is gone, and the daemon it last started still runs in its process group
[DOWN] <name> No pid file, or its supervisor and its daemon are gone

Stopping the service, and a final exit, remove the state file with the pid file.

kdos-bootctl

kdos-bootctl manages the A/B root slots and each slot’s kernel on the EFI system partition. Its state is /boot/efi/EFI/kdos/bootstate, and it rewrites the /KDOS entries of limine.conf to match. The state file lives on FAT, which has no journal, so every write is a temporary file, its fsync, a rename, then an fsync of the renamed file and a syncfs of the ESP; every other file it writes or removes there settles the same way. On Linux’s vfat a directory fsync does not carry a rename onto the disk: the reused directory entry is written through the renamed file’s inode, so the file’s own fsync writes it, and the syncfs writes the FAT and everything else (why). A file that cannot be parsed is treated as absent, never as partial.

Verb Does
status [--json] The active slot, the candidate, attempts and the BootNext trial state, and which version each slot holds (the default verb). A slot marked by unfill adds the line unfilled <x>: an update stopped while writing this slot. The next update writes it again; to write it at once, run kdos update apply --mount as root, and a trial set aside by picking the confirmed slot at the boot menu adds abandoned <x>: set aside at the boot menu
list [--json[=short\|pretty\|off]] The boot entries, one per slot, in the shape bootctl list --json prints
select [<a\|b>] Run at boot by the initramfs: decide which slot’s root to use, given the boot-menu entry that was picked, and roll back a candidate whose trial boot was spent (recorded in failed). Picking the confirmed slot’s entry sets the candidate aside, recorded in abandoned, which no notice reports as a failure: during a menu-led trial, and from a BootNext trial menu, whose confirmed-slot entries carry kdos_menu=trial. A BootNext boot that reaches the confirmed slot without that word is a firmware fallback and is recorded in failed
try <a\|b> [n] Mark a slot as the candidate for the next boot. With UEFI variables it arms a one-shot BootNext trial; otherwise the menu leads with the candidate for n boots (default 3). Refused for the active slot, a slot with no root, a slot with no kernel on the ESP, or an unfilled slot (bootctl: slot <x> is incomplete — an update stopped while writing it;kdos update applywrites it again), each with exit 1
cancel Forget a trial that has not booted: the firmware’s one-shot first, then the state, so a power cut between the two comes up on the confirmed slot. no trial is armed when there is none
mark-good Confirm the running slot after a successful boot, clearing the trial. kdos-sysupdated runs it once both bless marks exist; a trial armed earlier in the same boot is left as it is. When the kernel command line names a bootstate= and the state cannot be read it exits 1 with bootctl: the command line names a boot state and <path> cannot be read — is the ESP mounted?; with no bootstate= it exits 0
unfill <a\|b> Record that an update is writing that slot (unfilled = <x> in the state) and rewrite limine.conf without the slot’s /KDOS <version> (slot <X>) entry. kdos update apply runs it before its first write into the slot. Refused with exit 1 for the active slot (bootctl: slot <x> is active; it is not written) and an armed one (bootctl: slot <x> is armed — cancel the trial first; it is not written); exit 1 with bootctl: cannot rewrite the boot menu when the menu cannot be written, and 2 on bad usage
set-slot <a\|b> <uuid> [<luks-uuid>] Record a slot’s root filesystem and, when encrypted, its LUKS container; without one the slot is recorded as unencrypted
crypt <fs-uuid> Print the LUKS container recorded for the slot whose root filesystem has that UUID; asked by the initramfs after select, silent with exit 1 when there is none
deploy <root> [<a\|b>] Copy the kernel and initramfs from a slot’s root into that slot’s directory on the ESP, with the root’s identity as EFI/kdos/<slot>/release. Deploying into the unfilled slot clears the mark and rewrites the menu, so its entry comes back. The installer writes each slot’s first release record itself, a and, on an A/B install, b, so both slots carry a version from the first boot
theme [--print] [<accent>] Write the accent’s console palette to /etc/vtrgb and rewrite the theme lines of limine.conf (the default accent when none is named); a machine with no limine.conf keeps its boot menu and still exits 0. --print prints the limine.conf lines and writes nothing
splash phosphor\|modern The boot splash’s motion, as kdos.splash= on every KDOS entry
palette [<accent>] Print the console palette (the /etc/vtrgb format) for an accent, the default one when none is named

status --json prints one line. configured, live, active, trying, slot_a, slot_b, crypt_a, crypt_b and running are read by kdos update with exact string matches, each spelled "key": value with the space, so their spelling is an interface; attempts, bootnext, next, failed (a trial that ended unconfirmed, or null), abandoned (a trial set aside at the boot menu, or null), unfilled (the unfilled slot, or null), entry and slots (each slot’s state, title, version, build, date, tree and kernel) are for readers that parse JSON: the System Versions page, the logout screen, the notices and kdos-sysupdated. The unfilled slot’s state in slots is incomplete, which takes precedence over failed, and failed over abandoned. A running slot that is neither the confirmed one nor on trial, picked at the boot menu, is visiting, ahead of all three: the text reads slot <x> <title>, visiting (this boot only) and ends trying nothing — this boot was picked from the menu; the next boot starts <active>, where a boot of the confirmed slot ends trying nothing — this slot is confirmed good.

An install with one root has a boot state naming slot A alone: status --json prints "configured": true with "slot_b": "", and the text’s other line reads other none: this machine has one root and no rollback. With no boot state at all status and list exit 1: on the live medium, where / is an overlay in /proc/mounts, they say this is the live medium — it has no boot state and no slots; install KDOS for A/B updates and rollback, and status --json prints {"configured": false, "live": true}; where the directory that holds EFI/kdos/bootstate is no mount point (it is on its parent’s filesystem, as /boot/efi is in the emergency shell) status says the ESP is not mounted at /boot/efi, so the boot state cannot be read; mount /boot/efi; elsewhere they say no boot state at /boot/efi/EFI/kdos/bootstate — this machine has one root and no rollback, and status --json prints {"configured": false}.

The ESP is root’s alone, so every run as root against this machine’s own state also writes world-readable copies a session can read: /run/kdos/bootstate.json (status --json), /run/kdos/bootstate.txt (status’s text), /run/kdos/boot-entries.json (list --json=short) and /run/kdos/slot.json. A status or --json read that cannot open the state file prints those copies instead, so the logout screen, the welcome tour, About this System and a user at a shell answer without root; a user’s status with no copy published says the boot state at <path> is readable by root alone; `kdos-bootctl status --json` prints the copy published in /run/kdos and exits 1. kdos-sysupdated refreshes them at start, every half minute and after each change it makes, and try, cancel, mark-good, set-slot and deploy write them as they change the state.

It is also copied into the initramfs. The full boot flow is in A/B slot selection.

kdos-shot

kdos-shot [region|screen|full|window|qr]
kdos-shot --help

Spectacle takes the picture, in its background mode without its own notification (spectacle -b -n -o <file>): it is the one program KWin hands a screen to, through its ScreenShot2 interface. What kdos-shot adds is the naming, the clipboard, one notification and qr. A rectangle stays in Spectacle’s overlay after the drag, which can still move or resize it, and nothing is captured or decoded until it is accepted.

Mode Takes
region (the default) A rectangle you drag out (spectacle -r) and accept with Return or the overlay’s Accept; Escape cancels and saves nothing
screen The screen under the pointer (-m)
full Every screen (-f)
window The active window (-a)
qr A rectangle you drag out and accept with Return or the overlay’s Accept, read as a QR code by zbarimg, with the decoded text copied to the clipboard

A screenshot is saved as ~/Pictures/Screenshots/kdos-<date>-<time>.png (kdos-%Y%m%d-%H%M%S.png), or under $XDG_PICTURES_DIR/Screenshots when that variable is set, copied to the clipboard with wl-copy, announced in a notification, and its path printed. A second shot in the same second is kdos-<date>-<time>-2.png, then -3 and on: the name is reserved before Spectacle runs, so no shot replaces another. A notification the server refuses (Plasma limits a burst) is not reported. qr writes its picture only to the runtime directory and deletes it on every path out, so nothing appears under ~/Pictures. A QR code is a secret more often than not, a Wi-Fi password or a pairing token, so its text goes to the clipboard and nowhere else, without the trailing newline, and the notification says only that a code was copied, never what it says.

Every argument is read before anything is done. -h and --help print the usage to standard output and exit 0. --geom is refused with an error and exit 1, before the screenshot directory is made: selection on this desktop is done with the pointer. Any other option, a second mode or an unknown mode prints the usage to standard error and exits 1, so a mistyped argument never leaves the command waiting for a drag. Without Spectacle it says so and exits 1. The Print keys run Spectacle itself; kdos-shot is what KRunner’s capture.* routes run.

kdos-banner and kdos-getty

kdos-banner draws the login banner: the KDOS logo beside the output of fastfetch --logo none, revealed line by line like a CRT beam. While it animates, any key skips the rest.

On a short terminal (one whose height is known) it shrinks to fit, keeping the user@host, SYSTEM and OS lines at the top of the fetch on screen:

  1. When the logo, the fetch and a prompt row do not fit, the logo is left out and the fetch is printed alone.
  2. When the fetch and a prompt row still do not fit, whole sections (the blocks between blank lines) are dropped from the fetch’s end until the rest fits.
  3. When no section break fits, the fetch is cut one row short of the screen.

--plain prints the banner with no animation, so its output is the same every time and can be compared. The same plain banner is printed when standard output is not a terminal, when KDOS_NO_ANIM is set, when TERM is unset or dumb, or when the terminal is too short for the banner.

fastfetch takes its parent process for the shell, and that parent is kdos-banner, so the banner runs it with FFTS_IGNORE_PARENT=1: the Shell row names the login shell, and the Terminal row the terminal fastfetch detects past it (konsole in Konsole).

kdos-getty <ttyN> <getty...> wraps each console getty in /etc/inittab. It puts the console back into text mode first, because the splash leaves tty1 in graphics mode for the display manager, and a getty on a console in graphics mode would wait at a prompt nobody can see. It then waits for the kernel’s framebuffer console to take over the terminal, loads the ter-kdos32n font and the accent’s sixteen colours from /etc/vtrgb, then runs the getty. Loading earlier would be undone, because the take-over resets every console to the kernel’s built-in font. Limits, control groups and the session itself are not its job: every login below it is a PAM login, and pam_limits and pam_elogind do all three.

kdos-fetch-app and kdos-fetch-static

kdos-fetch-app [--box <name>] [--image <image>] <app>
kdos-fetch-app --remove [--box <name>] <app>
sudo kdos-fetch-static <name> <url> <sha256>

kdos-fetch-app installs an application into a distrobox container with the box’s own package manager (apt-get, dnf or pacman) and exports to the host what the package installed. It is the route for a program that exists in another distribution’s archive and nowhere else. Its steps print as ==> lines as they happen, piped or not, and -h or --help prints the usage and exits 0. For example:

kdos-fetch-app firefox-esr
kdos-fetch-app --box arch --image archlinux:latest neovim
kdos-fetch-app --remove firefox-esr

--box defaults to kdos-debian. --image defaults to debian:stable and is used only when the box does not exist yet. A box it creates is made with distrobox create --no-entry, so the menu gets a launcher for the application only, not for the box itself, and distrobox’s closing successfully created and To enter, run: lines are not printed.

What is exported. The package’s own file list (dpkg-query -L, rpm -ql or pacman -Qlq) decides:

distrobox names an export <box>-<file>.desktop, but KWin and the Task Manager find a window’s icon by the desktop file named after its app id (kdos appid). So when no <file>.desktop exists in XDG_DATA_HOME or XDG_DATA_DIRS, the export is copied to ~/.local/share/applications/<file>.desktop with X-KDOS-Fetch-Box=<box> and the same Exec and Icon, and the export itself gets NoDisplay=true. The copy is then the one entry the menu lists, a pin names and the Task Manager resolves the window to, so a pinned launcher and its running window are one task. A host entry of that name is left to the host’s application, and the export stays the visible one.

The first run needs the network, even when the image is already in the image store: on a box’s first start distrobox installs sudo and the rest of its dependencies into it. Its setup steps reach the terminal as distrobox writes them, except its closing Container Setup Complete!, which distrobox prints even when that install failed and which is therefore dropped; the command’s own lines report the outcome. Before the package manager runs, the command prints ==> Running <manager> inside the box (a few minutes the first time); the manager’s own output is not shown, on an install as on a --remove.

A box without sudo is taken for one whose first setup did not finish:

The box What happens
Created by this run Removed with distrobox rm --force; exit 1 with kdos-fetch-app: the box <box> did not finish its first setup — the network is needed the first time; run again when online
kdos-debian, from before Removed and created again once over the --image image before the install. If the new box has no sudo either, it is removed and the command exits 1 with the same sentence; if the old box cannot be removed, the command exits 1 naming distrobox rm kdos-debian as the repair
Another name given with --box Left alone; exit 1 naming distrobox rm <box> as the repair

An image with none of the three managers is refused with kdos-fetch-app: <image> has none of apt-get, dnf or pacman and exit 1, and a box the same run created for it is removed again with distrobox rm --force; a box that existed before is left alone.

--remove deletes the exports the package’s file list names, and each copy that box’s export made, then uninstalls the package. A package that is not installed in the box is refused with kdos-fetch-app: '<app>' is not installed inside '<box>' and exit 1.

The application name reaches the box’s package manager as a separate argument and is never pasted into a command string, so a name containing a quote or other shell characters is looked up as a name and cannot run anything as the box’s root.

kdos-fetch-static downloads <url>, checks it against <sha256>, and installs the binary (or, from a tarball, the file called <name>) as /usr/local/bin/<name>. It must run as root, because it writes there. A .tar, .tar.gz, .tgz, .tar.xz, .tar.bz2 or .tar.zst URL is treated as a tarball; anything else as a plain binary.

kdos-sfx

kdos-sfx login | notify | error | degauss | logout | warning
kdos-sfx complete | added | removed
kdos-sfx --route
kdos-sfx render <dir> [--format oga|wav]

The machine’s sounds, synthesised from square and triangle waves in the program itself, so there are no sample files. render writes them out once, at build time, as the KDOS sound theme’s files (the kdos-sounds port runs it): the freedesktop names Plasma plays, desktop-login, desktop-logout, message-new-instant, dialog-error, dialog-warning, complete, device-added and device-removed, so the session and this command make the same noise from the same numbers. Played by name, a sound goes through pw-cat when PipeWire is running and through aplay otherwise (the console case), and the command returns at once while a child process plays; --route prints which it would use. With no audio device, no player or no session it exits 0 without a word, because a decoration that prints an error at every login is one people remove. $KDOS_NO_SFX set to anything mutes it.

kdos-mpctl

kdos-mpctl toggle | stop | next | prev
kdos-mpctl mpris

mpd speaks its own protocol and no MPRIS, and Plasma reaches a player only through MPRIS: the media keys, the Media Player applet, the lock screen’s controls and KDE Connect all ask the session bus. mpris is the bridge: a small service, started at login by the autostart entry kdos-mpris.desktop (only where mpd is installed), that owns org.mpris.MediaPlayer2.mpd while mpd is running and answers for it, following mpd’s own idle so the applet’s title and play state change when mpd’s do, without polling. With no mpd it holds no name and looks again every five seconds, so mpd started, stopped and restarted under it keeps its media keys; it ends with SIGTERM or with the session bus.

The transport verbs are what a script or a KRunner line runs. mpd (over its socket at $XDG_RUNTIME_DIR/mpd/socket, never TCP) and every MPRIS player on the session bus are ranked on one scale, playing 3, paused 2, anything else 1, and the highest takes the key, mpd winning a tie:

One player answers each key, never two, or a toggle would start one while it paused the other. toggle sends a stopped mpd play, because mpd’s bare pause does nothing while stopped. A player that does not answer within two seconds costs that key press and nothing else. With no mpd and no player on the bus it prints no player on this login and exits 1.

The image ships no mpd.conf, and writing one is what starts mpd at the next login (or at once, with service --user start mpd). The user service makes $XDG_RUNTIME_DIR/mpd before it starts mpd, and /etc/profile.d/45-mpd.sh sets MPD_HOST to the socket in it, so mpc, rmpc and ncmpcpp find the same daemon. A configuration that serves that socket and plays through PipeWire, as ~/.config/mpd/mpd.conf:

music_directory    "~/Music"
playlist_directory "~/.local/share/mpd/playlists"
db_file            "~/.local/share/mpd/database"
state_file         "~/.local/share/mpd/state"
bind_to_address    "$XDG_RUNTIME_DIR/mpd/socket"
audio_output {
    type "pipewire"
    name "PipeWire"
}

mpd expands ~ and $XDG_RUNTIME_DIR itself. The directories under ~/.local/share/mpd must exist before the first start.

libbasu, the D-Bus library, is loaded at run time rather than linked, because this binary is also ksvc, kdos-getty and the kdos-bootctl the initramfs copies with a hand-kept library list.

See also


Part IV — Programs, chapter 28. Previous: 27. kinstall · Contents · Next: 29. kdos-bb