Skip to content

Commit 5dfae63

Browse files
committed
desktops: clean up headers for the mkdocs sidebar TOC
The auto-generated left-nav was rendering badly: - YAML schema sub-headers like 'Per-release block (releases.<codename>)' had angle brackets that mkdocs's TOC generator passed through as raw text, producing 'releases <codename>' with a literal '<' / '>' character and a missing dot. - Bash module API headers carried the full function signature inline, e.g. module_desktops <command> [de=<name>] [tier=<tier>] [arch=<arch>] [release=<release>] This wrapped over multiple lines in the sidebar and looked like garbage. Two fixes: 1. Drop angle-bracket parameter hints from every header. The schema sections become 'Tier blocks', 'Per-release block', 'Custom repository block', etc. The information that used to be in the header (the parent path like releases.<codename>) is already covered in the body text. 2. For each bash module function, the header is now just the function name (no signature, no inline backticks). The signature moves into a fenced code block on the line below — visible to readers, invisible to the sidebar TOC. Before: ### `module_desktops <command> [de=<name>] [tier=<tier>] [arch=<arch>] [release=<release>]` After: ### module_desktops ```text module_desktops <command> [de=<name>] [tier=<tier>] [arch=<arch>] [release=<release>] ``` Same treatment for the Common pitfalls subheaders, the parser helper section header, and the common.yaml / 'List and JSON list modes' subheaders — drop the inline backticks so the sidebar formatting is consistent. No content changes; this is purely a sidebar-rendering fix.
1 parent 83aec10 commit 5dfae63

1 file changed

Lines changed: 54 additions & 18 deletions

File tree

docs/Developer-Guide_Desktops.md

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Each desktop is defined in a single YAML file under `tools/modules/desktops/yaml
113113
| `releases` | mapping | yes | Per-release overrides keyed by release codename (`bookworm`, `trixie`, `noble`, `plucky`, ...). |
114114
| `repo` | mapping | optional | Custom APT repository, see below. |
115115

116-
### Tier blocks (`tiers.<tier>`)
116+
### Tier blocks
117117

118118
| Field | Type | Description |
119119
|---|---|---|
@@ -123,7 +123,7 @@ Each desktop is defined in a single YAML file under `tools/modules/desktops/yaml
123123

124124
The first DE-specific package that survives all filters becomes `DESKTOP_PRIMARY_PKG`, used by `module_desktops status` for `dpkg -l` checks. It must come from the DE's own `tiers.minimal.packages` block, not from `common.yaml`, otherwise every DE would share the same primary package.
125125

126-
### Per-release block (`releases.<codename>`)
126+
### Per-release block
127127

128128
The release block is **orthogonal** to the tier walk: it applies to whatever tier is being installed. Use it for things that vary by release rather than by user choice (e.g. trixie's pulseaudio→pipewire swap, bookworm's `gnome-calculator` addition).
129129

@@ -155,7 +155,7 @@ Use the per-arch layer for permanent arch-wide holes (e.g. `blender` always miss
155155

156156
`tier_overrides` can live in `common.yaml` (applies to every DE) or in a per-DE YAML (applies only to that DE). The parser merges common first, then per-DE.
157157

158-
### Custom repository block (`repo`)
158+
### Custom repository block
159159

160160
| Field | Type | Description |
161161
|---|---|---|
@@ -253,7 +253,7 @@ releases:
253253
architectures: [arm64, amd64]
254254
```
255255

256-
### `common.yaml`
256+
### common.yaml
257257

258258
`common.yaml` carries the per-tier defaults that apply to every desktop, the browser substitution table, and any cross-DE `tier_overrides`. Per-DE YAMLs only declare a `tiers` block when they want to add packages on top of common or override common-tier entries.
259259

@@ -359,7 +359,7 @@ The per-release layer is needed because the same arch can resolve differently ac
359359
- `chromium` isn't built for riscv64 in either Debian or Ubuntu.
360360
- `firefox` isn't built for noble/plucky riscv64 either.
361361

362-
## Python helper: `parse_desktop_yaml.py`
362+
## Python helper: parse_desktop_yaml.py
363363

364364
Single-purpose CLI that bash modules invoke via `python3`. All YAML parsing and validation happens here so the bash side stays free of YAML logic.
365365

@@ -421,15 +421,19 @@ The parser is strict about top-level structure but tolerant of malformed sub-nod
421421
- **Path traversal guard**`de_name` is resolved against `yaml_dir` via `os.path.realpath`/`commonpath`. Anything outside the directory (`../...`, absolute paths, symlink escapes) is rejected with `Error: invalid desktop name '<name>'` and exit 1.
422422
- **Tolerant normalization**`tiers`, `releases`, `architectures`, `tier_overrides`, `repo`, every list field passes through `_as_dict` / `_as_list` helpers. Wrong-typed nodes coerce to safe empty defaults (`{}` or `[]`) instead of raising `AttributeError` or doing surprising substring matches like `arch in "arm64"`.
423423

424-
### `--list` / `--list-json` mode
424+
### List and JSON list modes
425425

426426
Iterates every `*.yaml` (excluding `common.yaml`), parses each one's release block, and prints **only entries supported on the requested (release, arch)**. Used by `module_desktops install` to show available desktops on error and by `module_desktops supported` to expose a machine-readable catalog. These modes do not require `--tier`.
427427

428428
## Bash module API
429429

430430
All functions are loaded by configng's module loader. They share global state (`DESKTOP_*` variables, `desktops_dir`, `DISTROID`) — call sites must follow the documented order.
431431

432-
### `module_desktops <command> [de=<name>] [tier=<tier>] [arch=<arch>] [release=<release>]`
432+
### module_desktops
433+
434+
```text
435+
module_desktops <command> [de=<name>] [tier=<tier>] [arch=<arch>] [release=<release>]
436+
```
433437

434438
Top-level dispatcher. The `de=`, `tier=`, `arch=`, `release=` arguments are parsed positionally from `$@`.
435439

@@ -469,7 +473,11 @@ Two files per installed desktop, both under `/etc/armbian/desktop/`:
469473
| `sddm` | `/etc/sddm.conf.d/autologin.conf` (drop-in, non-destructive) |
470474
| `lightdm` | `/etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf` (drop-in, non-destructive) |
471475

472-
### `module_desktop_yamlparse <de_name> [arch] [release] [tier]`
476+
### module_desktop_yamlparse
477+
478+
```text
479+
module_desktop_yamlparse <de_name> [arch] [release] [tier]
480+
```
473481

474482
Wraps `parse_desktop_yaml.py`. Resets all `DESKTOP_*` globals, runs the helper, and `eval`s its stdout. Returns 1 on parse failure (with the parser's stderr surfaced).
475483

@@ -487,15 +495,27 @@ echo "$DESKTOP_TIER" # → full
487495
echo "$DESKTOP_PACKAGES" # → minimal + mid + full set, with browser resolved
488496
```
489497

490-
### `module_desktop_yamlparse_list [arch] [release]`
498+
### module_desktop_yamlparse_list
499+
500+
```text
501+
module_desktop_yamlparse_list [arch] [release]
502+
```
491503

492504
Calls the parser with `--list` and prints TSV to stdout. Used to assemble the "Available: ..." hint shown when `install` is invoked without `de=`.
493505

494-
### `module_desktop_supported <de_name> [arch] [release]`
506+
### module_desktop_supported
507+
508+
```text
509+
module_desktop_supported <de_name> [arch] [release]
510+
```
495511

496512
Convenience wrapper around `module_desktop_yamlparse` that returns 0/1 based on `DESKTOP_SUPPORTED`. Suppresses parser stderr — meant for predicates and CI gates.
497513

498-
### `module_desktop_repo <de_name>`
514+
### module_desktop_repo
515+
516+
```text
517+
module_desktop_repo <de_name>
518+
```
499519

500520
Sets up a custom APT source. Must be called **after** `module_desktop_yamlparse` because it consumes `DESKTOP_REPO_URL`, `DESKTOP_REPO_KEY_URL`, `DESKTOP_REPO_KEYRING`.
501521

@@ -508,7 +528,11 @@ Behavior:
508528

509529
A no-op if the YAML has no `repo:` block.
510530

511-
### `module_desktop_branding <de_name>`
531+
### module_desktop_branding
532+
533+
```text
534+
module_desktop_branding <de_name>
535+
```
512536

513537
Copies branding assets and runs the optional postinst hook. Idempotent — every step is guarded with `[[ -d ... ]]`.
514538

@@ -526,11 +550,19 @@ Copies branding assets and runs the optional postinst hook. Idempotent — every
526550

527551
The distributor logo for GNOME Settings → About / KDE Info Center / etc. is **not** installed from here — that file ships from `armbian-base-files` so it stays in sync with the `LOGO=` line in `/etc/os-release`.
528552

529-
### `module_desktop_getuser`
553+
### module_desktop_getuser
554+
555+
```text
556+
module_desktop_getuser
557+
```
530558

531559
Returns the first non-root, non-system user with a real login shell. Prefers `$SUDO_USER` if set and not root, otherwise scans `/etc/passwd` for the first entry with `1000 ≤ uid < 65534` and a shell that does not match `nologin|false`. Exits 1 if none is found.
532560

533-
### `module_update_skel install`
561+
### module_update_skel
562+
563+
```text
564+
module_update_skel install
565+
```
534566

535567
Walks `getent passwd`, and for every regular user (`1000 ≤ uid < 65534`, home directory exists, not root):
536568

@@ -541,7 +573,11 @@ Walks `getent passwd`, and for every regular user (`1000 ≤ uid < 65534`, home
541573

542574
The recursive `chown` is critical: other package postinst scripts (caja, nemo, gnome-keyring, …) routinely leak root-owned files into the user's `~/.config` directory on first install. Without the recursive chown, those tools refuse to start on first login because they can't write their own config dirs.
543575

544-
### `module_appimage <install|remove|status> app=<name>`
576+
### module_appimage
577+
578+
```text
579+
module_appimage <install|remove|status> app=<name>
580+
```
545581

546582
Standalone AppImage helper. The internal `APPIMAGE_REPO` registry maps logical app names (e.g. `armbian-imager`) to GitHub `owner/repo` slugs and downloads the appropriate architecture-suffixed AppImage from the latest release. `module_appimage install` also installs `libfuse2`, `fuse3`, and the `libgles2`/`libegl1`/`libgl1`/`libgl1-mesa-dri` runtime so the AppImage can launch.
547583

@@ -702,7 +738,7 @@ This makes the same code path usable for image preseeding inside Docker without
702738

703739
## Common pitfalls
704740

705-
### `packages_uninstall` cascade
741+
### packages_uninstall cascade
706742

707743
Listing a package in `tiers.minimal.packages_uninstall` runs `apt-get remove --purge` on it after the install. If that package is a hard `Depends:` of any meta package the DE install pulled in, apt's autoremove cascade will yank the meta package along with it — and on systems with `APT::Get::AutomaticRemove "true"` (Ubuntu noble/plucky), the cascade keeps going and rips out a chunk of the desktop. Real examples that bit us:
708744
@@ -712,7 +748,7 @@ Listing a package in `tiers.minimal.packages_uninstall` runs `apt-get remove --p
712748
713749
**Rule**: never put a `Depends:` of a metapackage you ship into `packages_uninstall`. Verify with `apt-cache rdepends --installed <pkg>` before adding anything.
714750
715-
### Gnome `daemon.conf` vs `custom.conf`
751+
### Gnome daemon.conf vs custom.conf
716752
717753
Both Debian and Ubuntu ship a `gdm3` package, but they read different config files:
718754
@@ -723,7 +759,7 @@ Both Debian and Ubuntu ship a `gdm3` package, but they read different config fil
723759
724760
The `auto` path also edits the file in place via sed (preserving any user customization like `WaylandEnable=false`) rather than overwriting it with a fresh `cat > $file`.
725761
726-
### `login` regex anchoring
762+
### login regex anchoring
727763
728764
The stock Ubuntu noble `/etc/gdm3/custom.conf` template ships with a commented sample line:
729765

0 commit comments

Comments
 (0)