A tool that diagnoses problems in a Regolith Desktop installation and fixes them where that is safe. It knows the common ways a Regolith system goes wrong (apt sources, package sets, window manager partials, Xresources, looks, session environment, bars, displays, keyboard, power) and explains each finding with the file and line it comes from.
It has a command-line interface and a GTK 4 window, regolith-doctor-gtk, on top of the same core.
Early development. The workspace, the command-line skeleton, the core types, the platform check (ENV-001), the apt checks (APT-001 to APT-010), the package checks, the session checks and the resource checks exist, and so does a model of GNOME's settings read from files: settings shows, for each Regolith session, the value every GSettings key has and the file and line (or database) it comes from, and checks built on it find themes that are not installed, dark mode that misses GTK4 apps, Regolith's session defaults lost to user values, GNOME shortcuts on Regolith's keys, ignored power settings and disagreeing scaling. A model of the window manager configuration is there too: config lists, for each session, the files i3 or sway really reads with the package each comes from, and every variable, binding, bar and exec with its origin, and the configuration checks built on it find user partials that clash with or double the shipped ones, leftovers that load, configuration nothing reads, Regolith 2 names, changes that reach one session only, a lid switch that no longer suspends and hard-coded modifiers, and turn partials off by moving them aside. The bar, the monitor profiles and the keyboard are modelled too: bar shows what each session's bar loads and which file each entry comes from, keyboard shows the layouts each session settles on and what every key types, and checks built on them find bar files that break or hide blocks, block programs and devices that are gone, a refused Wayland bar configuration or a doubled bar, kanshi profiles that kanshi refuses, bindings a layout cannot press or presses twice, layouts set in places that fight each other, and media keys that die on the lock screen. The other checks are documented in docs/checks but not implemented yet; commands that are not implemented exit with status 4.
session shows how each Regolith session is put together, from the files alone: its environment with the file and line behind every value, the programs it autostarts, its portal backends and who takes its notifications.
keys shows what each resource key is set to in the i3 session and in the sway session, and which file and line set it, worked out from the files the way each session loads them (the C preprocessor, xrdb and trawld, the load order and the look selection), with no session running.
The doctor also asks the session you sit in: i3 or sway over their IPC socket, the session bus (notification daemons, the desktop portal, the systemd user manager), the X11 resource database and the compositor's journal. live prints what the running session reports in one shape for both window managers, and eight live checks judge it: a running configuration older than the files (CFG-015), loaded resources that differ from the Xresources file (XRES-009), workspace rules naming missing outputs (DISP-003), phantom outputs (DISP-004), a tray that shows on no output (BAR-004), a dead or crash-looping compositor (COMP-004), a portal that does not answer (PORT-002) and two notification daemons at once (NOTIF-002). snapshot save DIR records every answer, and --snapshot DIR judges the recording later, for any command, with the same verdicts; without a session or a snapshot the live checks are listed as skipped.
compare sets two systems side by side, such as a backup taken before an upgrade and the system now, two snapshots, or a root with its snapshot, and lists what changed for Regolith: the release and Regolith series, Regolith's packages and what they depend on, the apt sources as apt reads them, effective resources and settings, how each session is put together, the doctor's findings and what the running session reports. Lines that only moved and sources that were only rewritten in another format are not changes; the JSON output has a fixed order and the exit status says whether anything changed.
On the system it runs on, the doctor also consults the real programs. validate asks i3 -C and sway -C -d about each session's configuration and names the file and line behind every message, including i3's "Duplicate keybinding", which names none, and a check reports what they say that the static checks do not already cover. Another check parses each login file with the shell that reads it in each session and finds top-level exit, exec and set -e, and a third reads font names the way Pango does and asks fontconfig whether each family is installed, naming the package that provides it. Each program runs with a fixed environment in a private directory that is removed afterwards, and none runs for another root or a snapshot.
report is the safe replacement for pasting regolith-diagnostic into a bug report: it prints the same sections in the same order, built from the files and the session's answers instead of by running programs, then the findings, with login names, home paths, host names, MAC and e-mail addresses and secrets replaced by tokens that are the same on every run. report -o FILE writes it as one reproducible .tar.gz attachment holding the text, a JSON form and a snapshot that replays with --snapshot.
upgrade-check --to CODENAME [--lists DIR] foretells, before an Ubuntu release upgrade, what it will do to Regolith: whether the release upgrader would offer that release at all under the system's Prompt setting (and whether only its development mode would), whether the Regolith archive publishes the configured channel and series for it, how the upgrade switches the Regolith source off, and, from the target's package lists, which Regolith packages stay held, lose their candidate, are kept back, break a dependency, lean on a package the new release dropped or keep the old release's build. It reads files only and changes nothing.
fix, undo and history work, with the apt-source fixes, the fix for autoremove, the session fixes, the resource fixes, the window manager configuration fixes, BAR-004's tray fix and mechanical fixes of bar and monitor-profile files in the home (a missing newline, a leftover file moved aside, a refused profile set apart); in a running session fix also reloads the window manager (CFG-015) and restarts the compositor unit (COMP-004). A fix shows its change as a patch first (fix --dry-run), touches only the broken part of a file, keeps each file's owner, group and mode, is written as one transaction that a failure or a crash rolls back, and can be undone later byte for byte. Fixes of files in the home keep their transactions in the home, so a user can fix their own files. When the doctor may not change a file, it says which command to run instead.
- docs/architecture.md: how it is meant to work.
- docs/cli.md: commands, options, exit codes and JSON output.
- docs/checks: one page per check.
You need a Rust toolchain; rust-toolchain.toml pins the version and rustup installs it on first use.
cargo build --release
cargo test
cargo fmt --check
cargo clippy --all-targets -- -D warningsRun it:
target/release/regolith-doctor check
target/release/regolith-doctor explain ENV-001
target/release/regolith-doctor --root tests/fixtures/env-001/arch --json check
target/release/regolith-doctor fix --dry-run
sudo target/release/regolith-doctor fix
target/release/regolith-doctor history
target/release/regolith-doctor session PATH XDG_CURRENT_DESKTOP
target/release/regolith-doctor live
target/release/regolith-doctor snapshot save ~/doctor-snapshot
target/release/regolith-doctor --snapshot ~/doctor-snapshot check
target/release/regolith-doctor keys wm.gaps.inner.size regolith.look.path
target/release/regolith-doctor report -o ~/regolith-report.tar.gz--root makes the doctor read another system tree instead of /, which is how the tests run checks against the fixtures in tests/fixtures/.
The window needs the GTK 4 development files, version 4.12 or newer (libgtk-4-dev on Debian and Ubuntu, gtk4-devel on Fedora); cargo build --release builds it with the rest. Start it from a graphical session, X11 or Wayland; it takes the same --root, --home and --snapshot options and a starting --session filter:
target/release/regolith-doctor-gtk
target/release/regolith-doctor-gtk --session sway
target/release/regolith-doctor-gtk --snapshot ~/doctor-snapshot| Path | Contents |
|---|---|
crates/doctor-core |
Check ids, findings, reports, the check registry, file access under --root |
crates/doctor-checks |
The checks and their compiled-in documentation |
crates/regolith-doctor |
The command-line program |
crates/regolith-doctor-gtk |
The GTK 4 window |
data/ |
Tables the checks use, with the source of each fact |
docs/ |
Design, command line and per-check documentation |
tests/fixtures/ |
System trees the tests run against |
Apache-2.0, see LICENSE.