refactor(pi): route related skills through focused guides
d9c0b0e500022d7547142685f4f83c222dd00b9a
Oliver Jan Krylow <oliver@bugabinga.net> ·
SSH signature · not checked
- Parent 1: b0cd870014bd
bugabingas dorkfiles
d9c0b0e500022d7547142685f4f83c222dd00b9a
Oliver Jan Krylow <oliver@bugabinga.net> ·
SSH signature · not checked
+3239 / −3151 text lines · all files grouped into 32 bars
new file mode 100644+62 / −0 text lines
# quickshell skillGuidance and small examples for building Linux desktop components with Quickshell.Read [`SKILL.md`](SKILL.md) first.## Contents```textquickshell/├── SKILL.md├── references/├── examples/├── bin/└── package.json```The references intentionally avoid broad service API summaries.Resolve the installed `qs` version and consult its official type pages before writing service, IPC, windowing, or authentication code.## ExamplesThe examples cover:1. a single panel2. one panel per screen3. a clock panel4. PipeWire volume display and control5. a volume OSD6. typed IPC functions7. a composite bar8. a minimal notification daemonExamples are teaching inputs, not proof of target-desktop behavior.Do not launch them on the user's real desktop as routine validation.Notification and authentication components can claim session-global protocols or services.## Validation levels- `npm test` checks the Node helper tools.- `qmllint` checks supported QML structure and installed imports without launching the shell.- An offscreen load check establishes load behavior only.- Interaction acceptance requires exercising input, IPC, timers, hotplug, and service events.- Visual acceptance requires observing mapped surfaces on the target display setup.Runtime checks belong in a nested compositor with isolated runtime and session services.A nested compositor without an isolated D-Bus and service environment is insufficient for notification, tray, Polkit, greetd, or similar checks.Never claim interaction or visual validation from static or offscreen checks.### Upstream tooling boundary[Quickshell recommends `qmlls` with generated `.qmlls.ini`](https://quickshell.org/docs/v0.3.1/guide/install-setup/#language-server) and explicitly documents unresolved `PanelWindow` types.Its runtime backend registration is not fully described by static `.qmltypes`; [issue #543](https://github.com/quickshell-mirror/quickshell/issues/543) tracks related false positives.Use Qt6 tooling, not an unverified executable named `qmllint` that may belong to Qt5.The earlier claim that typed `IpcHandler` functions cause an independent linter defect was incorrect: minimal typed IPC passes with Qt6 and the existing project lint policy.Keep that policy unchanged; do not add warning suppressions or fabricated metadata.The offscreen Qt platform has no Quickshell `PanelWindow` backend.Mapped surfaces, services, and interaction require an isolated nested compositor rather than more offscreen retries.## HelpersSee [`bin/README.md`](bin/README.md).The helpers use Node built-ins and have no package dependencies.new file mode 100644+142 / −0 text lines
---name: quickshelllicense: LGPL-3.0description: "Use for building, reviewing, or debugging Quickshell desktop components and qs IPC. Not general QML or compositor config."---# Quickshell## Start with the installed version**Do not write Quickshell APIs from memory.**Quickshell changes between releases, especially service modules.1. Run `qs --version`.2. Read the matching official guide and type pages under `https://quickshell.org/docs/v<version>/`.3. When local and web versions may differ, inspect the installed `*.qmltypes` files under `/usr/lib/qt6/qml/Quickshell/` or the platform's equivalent QML import path.4. Cross-check a nearby official example before using a service or compositor-specific API.Use [`references/getting-fresh-docs.md`](references/getting-fresh-docs.md) for the lookup procedure.If cloning upstream examples is necessary, use the `git_clone_safe` tool with the repository URL and an isolated destination.It is a tool, not a shell command.## ModelA Quickshell entry file has one QML root object.There is no rule that it must be `ShellRoot` or `Scope`.A single `PanelWindow` and a per-screen `Variants` object are both valid roots.`ShellRoot` is optional and provides inline shell settings.`Scope` groups non-visual reloadable objects.```qmlimport QtQuickimport QuickshellPanelWindow { anchors { top: true; left: true; right: true } implicitHeight: 30 Text { anchors.centerIn: parent; text: "hello" }}```For one instance per screen:```qmlimport QtQuickimport QuickshellVariants { model: Quickshell.screens delegate: Component { PanelWindow { required property var modelData screen: modelData anchors { top: true; left: true; right: true } implicitHeight: 30 } }}```Use:- `PanelWindow` for anchored panels and layer-shell surfaces.- `FloatingWindow` for ordinary desktop windows.- `PopupWindow` for a popup anchored to another Quickshell window.- `ShellRoot` when the entry needs multiple child objects or inline shell settings.- `Scope` when non-visual objects need a common reload scope.`WlrLayershell` is an attached object on `PanelWindow`, not on `FloatingWindow`.See [`references/windowing.md`](references/windowing.md).## QML rules that matter here- Keep state reactive with property bindings.- Implicit size flows from child to parent; actual size flows from parent to child.- Do not use `childrenRect` as a generic container sizing shortcut because it commonly creates binding loops.- For a service-backed `Slider`, bind `value` to service state and write user movement in `onMoved`. Do not replace the binding with imperative synchronization handlers.- Use `Connections` for signals from a changing external object.- Use `PwObjectTracker` when the matching installed PipeWire docs require tracking an object.See [`references/patterns.md`](references/patterns.md) for the small set of retained patterns.## Services and privileged componentsFor notifications, PipeWire, MPRIS, PAM, greetd, Polkit, Bluetooth, networking, and system tray APIs,read the installed-version type page before coding.Do not advertise a notification capability unless the implementation actually provides it.Do not improvise PAM, greetd, or Polkit conversations.Use the official installed-version example and keep prompts separate from user responses.See [`references/services.md`](references/services.md).## Tooling: follow upstream firstRead the installed version's [official tooling recommendations](https://quickshell.org/docs/v0.3.1/guide/install-setup/#language-server) before diagnosing a linter or inventing metadata.Upstream recommends `qmlls` and an empty `.qmlls.ini` beside the entry point.Quickshell generates the machine-specific configuration; gitignore it and do not hand-maintain its paths.Use the matching Qt major version for both `qmlls` and `qmllint`.On Arch, `/usr/lib/qt6/bin/qmllint` is Qt6; the bare `qmllint` command may be Qt5.Upstream explicitly documents that `PanelWindow` cannot be resolved by the language server.Its runtime backend registration is not fully represented in static metadata; see [issue #543](https://github.com/quickshell-mirror/quickshell/issues/543).This is not evidence that valid panel QML or typed IPC functions are broken.Capture complete stdout/stderr from a minimal reproduction with the correct Qt tool before attributing a failure.Do not fabricate type metadata, remove typing, or disable additional warning categories to obtain a pass.Keep project-approved lint policy and verify actual loading in a nested compositor.## ValidationSeparate these evidence levels:1. **Static:** `qmllint` resolves supported imports and QML structure.2. **Load:** Quickshell loads the configuration without diagnostics.3. **Interaction:** input, IPC, timers, hotplug, and service events behave correctly.4. **Visual:** placement, sizing, clipping, color, typography, and animation are accepted on target displays.A static or offscreen load check proves neither interaction nor visual correctness.Do not claim UI validation without observing and exercising the mapped surfaces.**Never test desktop components against the user's real desktop session by default.**A test instance can claim D-Bus names, notification ownership, layer-shell surfaces, session-lock protocols, or authentication agents.Use a nested compositor plus isolated runtime, D-Bus, and service state for runtime checks.Offscreen validation is limited to parsing or loading and must be reported as such.Never run live authentication or lockscreen tests without an explicit isolated test plan.Run helper tests from this skill directory:```shnpm test```## References- [`references/getting-fresh-docs.md`](references/getting-fresh-docs.md)- [`references/patterns.md`](references/patterns.md)- [`references/windowing.md`](references/windowing.md)- [`references/services.md`](references/services.md)- [`references/resources.md`](references/resources.md)- [`references/packaging.md`](references/packaging.md)- [`examples/`](examples/)- `qml` skill for QML language and layout detailsnew file mode 100644+69 / −0 text lines
# quickshell CLI helpersThree cross-platform CLI tools written in Node.js ESM (`.mjs` files). No npm dependencies, only Node built-ins. Run with `node <tool>.mjs` or directly (`./<tool>.mjs` after `chmod +x`).## qs-versionPrint the installed `qs` version and the matching docs URL.```sh$ qs-versionQuickshell 0.3.0https://quickshell.org/docs/v0.3.0/```## qs-scaffoldScaffold a new Quickshell config from an example. Copies `shell.qml` (and any supporting `*.qml` files), the `README.md`, and creates an empty `.qmlls.ini` (LSP marker).```shqs-scaffold mybar # uses 02-per-monitor-bar (default)qs-scaffold foo --from 03-clock # specific exampleqs-scaffold bar --from 07-composite-bar # multi-file: copies Bar.qml too```Result:```~/.config/quickshell/mybar/├── shell.qml├── Bar.qml (if the source example has one)├── README.md└── .qmlls.ini (empty; quickshell will populate)```Then run with `qs -c mybar`.Refuses to clobber an existing target.## qs-docPrint or open the docs URL for a type, namespaced or not.```shqs-doc PanelWindow # bare typehttps://quickshell.org/docs/v0.3.0/types/Quickshell/PanelWindowqs-doc Quickshell.Services.Pipewire.Pipewire # namespacedhttps://quickshell.org/docs/v0.3.0/types/Quickshell/Services/Pipewire/Pipewireqs-doc --list # full type indexhttps://quickshell.org/docs/v0.3.0/typesqs-doc PanelWindow --open # open in browser```## Cross-platform- No shell, no POSIX assumptions; pure `node:child_process`, `node:fs`, `node:os`, `node:path`.- `xdg-open` on Linux, `open` on macOS, `cmd /c start` on Windows for `--open`.- `XDG_CONFIG_HOME` honored; falls back to `~/.config` (Linux/macOS) or `%APPDATA%` (Windows).## TestingTests are in `test/` and use the built-in Node test runner.Run all from the skill root:```shnpm test```new file mode 100755+104 / −0 text lines
#!/usr/bin/env node// qs-doc.mjs: open or print docs for the installed Quickshell version.// Cross-platform: no shell, no POSIX assumptions. Pure Node builtins.//// Usage:// qs-doc <Type> # print URL for a type// qs-doc --list # print type index URL// qs-doc <Type> --open # open in default browser// qs-doc <Type> --print # print URL (explicit; same as default)//// Type names use the dot-path shown in the docs (e.g. PanelWindow,// Quickshell.Services.Pipewire.Pipewire).import { spawnSync } from "node:child_process";import { platform } from "node:os";function getVersion() { for (const bin of ["qs", "quickshell"]) { const r = spawnSync(bin, ["--version"], { encoding: "utf8" }); if (r.status === 0) { const m = r.stdout.match(/(\d+\.\d+\.\d+)/); if (m) return m[1]; } } return null;}function usage() { process.stderr.write( "usage: qs-doc <Type> [--open|--print]\n" + " qs-doc --list\n" + " Type: doc path like PanelWindow or Quickshell.Services.Pipewire.Pipewire\n" + " --open open the URL in the default browser\n" + " --print print the URL to stdout (default if stdout is a tty)\n", );}function openUrl(url) { const os = platform(); // Try each platform's open command. Each is a separate spawn without a shell. const candidates = os === "darwin" ? [["open", [url]]] : os === "win32" ? [["cmd", ["/c", "start", "", url]]] : [ ["xdg-open", [url]], ["wslview", [url]], ["sensible-browser", [url]], ]; for (const [cmd, args] of candidates) { const r = spawnSync(cmd, args, { stdio: "ignore" }); if (r.status === 0) return true; } return false;}const argv = process.argv.slice(2);if (argv.length === 0) { usage(); process.exit(1);}const wantList = argv[0] === "--list";const wantOpen = argv.includes("--open");const wantPrint = argv.includes("--print") || !wantOpen;const type = wantList ? null : argv.find((a) => !a.startsWith("--"));if (!wantList && !type) { usage(); process.exit(1);}const version = getVersion();if (!version) { process.stderr.write("qs-doc: cannot find `qs` or `quickshell` on PATH\n"); process.exit(1);}const url = wantList ? `https://quickshell.org/docs/v${version}/types` : (() => { // Type path: "PanelWindow" -> "Quickshell/PanelWindow", // "Quickshell.Services.Pipewire.Pipewire" -> "Quickshell/Services/Pipewire/Pipewire" const path = type.includes("/") ? type : type.startsWith("Quickshell") ? type.replace(/\./g, "/") : `Quickshell/${type.replace(/\./g, "/")}`; return `https://quickshell.org/docs/v${version}/types/${path}`; })();if (wantOpen) { if (!openUrl(url)) { process.stderr.write(`qs-doc: could not open browser; URL: ${url}\n`); process.exit(1); } process.stdout.write(`${url}\n`); process.exit(0);}if (wantPrint) { process.stdout.write(`${url}\n`); process.exit(0);}new file mode 100755+125 / −0 text lines
#!/usr/bin/env node// qs-scaffold.mjs: scaffold a new Quickshell config from an example.// Cross-platform: no shell, no POSIX assumptions. Pure Node builtins.//// Usage:// qs-scaffold <name> [--from <example-name>]//// Default example: 02-per-monitor-bar (canonical per-monitor shape).import { copyFileSync, existsSync, mkdirSync, readdirSync, statSync, writeFileSync,} from "node:fs";import { dirname, join } from "node:path";import { fileURLToPath } from "node:url";const __dirname = dirname(fileURLToPath(import.meta.url));const SKILL_ROOT = join(__dirname, "..");const EXAMPLES_DIR = join(SKILL_ROOT, "examples");const DEFAULT_EXAMPLE = "02-per-monitor-bar";function usage() { process.stderr.write("usage: qs-scaffold <name> [--from <example-name>]\n"); process.stderr.write( " example-name: e.g. 01-hello-bar, 07-composite-bar (omit the .qml)\n", );}function parseArgs(argv) { const out = { name: null, from: DEFAULT_EXAMPLE }; for (let i = 2; i < argv.length; i++) { const a = argv[i]; if (a === "-h" || a === "--help") { usage(); process.exit(0); } if (a === "--from") { const v = argv[++i]; if (!v) { process.stderr.write("qs-scaffold: --from requires a value\n"); process.exit(1); } out.from = v; continue; } if (a.startsWith("--")) { process.stderr.write(`qs-scaffold: unknown flag ${a}\n`); process.exit(1); } if (!out.name) { out.name = a; continue; } process.stderr.write(`qs-scaffold: unexpected positional arg ${a}\n`); process.exit(1); } return out;}function xdgConfigHome() { if (process.env.XDG_CONFIG_HOME) return process.env.XDG_CONFIG_HOME; if (process.env.HOME) return join(process.env.HOME, ".config"); // Windows fallback. if (process.env.APPDATA) return process.env.APPDATA; process.stderr.write( "qs-scaffold: cannot determine config dir (set XDG_CONFIG_HOME or HOME)\n", ); process.exit(1);}const { name, from } = parseArgs(process.argv);if (!name) { usage(); process.exit(1);}function requirePathSegment(label, value) { if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(value)) { process.stderr.write( `qs-scaffold: ${label} must be a single path segment: ${value}\n`, ); process.exit(1); }}requirePathSegment("name", name);requirePathSegment("example name", from);// Validate example dir.const exampleDir = join(EXAMPLES_DIR, from);if (!existsSync(exampleDir) || !statSync(exampleDir).isDirectory()) { process.stderr.write( `qs-scaffold: example not found: ${from} (looked in ${EXAMPLES_DIR})\n`, ); process.exit(1);}const configRoot = join(xdgConfigHome(), "quickshell");const target = join(configRoot, name);if (existsSync(target)) { process.stderr.write(`qs-scaffold: target already exists: ${target}\n`); process.exit(1);}mkdirSync(target, { recursive: true });// Copy the example dir's QML + README. Skip hidden / non-source files.for (const entry of readdirSync(exampleDir, { withFileTypes: true })) { if (!entry.isFile()) continue; if (entry.name.startsWith(".")) continue; if (!(entry.name.endsWith(".qml") || entry.name.endsWith(".md"))) continue; copyFileSync(join(exampleDir, entry.name), join(target, entry.name));}// Touch .qmlls.ini for LSP.writeFileSync(join(target, ".qmlls.ini"), "");process.stdout.write(`Scaffolded ${target}\n`);process.stdout.write(`Run: qs -c ${name}\n`);new file mode 100755+28 / −0 text lines
#!/usr/bin/env node// qs-version.mjs: print the installed qs version and matching docs URL.// Cross-platform: no shell, no POSIX assumptions. Pure Node builtins.import { spawnSync } from "node:child_process";function getVersion() { for (const bin of ["qs", "quickshell"]) { const r = spawnSync(bin, ["--version"], { encoding: "utf8" }); if (r.status === 0) { // Output looks like: "Quickshell 0.3.0 (revision , distributed by Arch Linux)" const m = r.stdout.match(/(\d+\.\d+\.\d+)/); if (m) return m[1]; } } return null;}const version = getVersion();if (!version) { process.stderr.write( "qs-version: cannot find `qs` or `quickshell` on PATH\n", ); process.exit(1);}process.stdout.write(`Quickshell ${version}\n`);process.stdout.write(`https://quickshell.org/docs/v${version}/\n`);new file mode 100644+59 / −0 text lines
// qs-doc.test.mjs// Run: node --test bin/test/qs-doc.test.mjsimport assert from "node:assert/strict";import { spawnSync } from "node:child_process";import { dirname, join } from "node:path";import { test } from "node:test";import { fileURLToPath } from "node:url";const __dirname = dirname(fileURLToPath(import.meta.url));const BIN = join(__dirname, "..", "qs-doc.mjs");test("qs-doc with no args prints usage", () => { const result = spawnSync("node", [BIN], { encoding: "utf8" }); assert.notEqual(result.status, 0); assert.match(result.stderr, /usage/i);});test("qs-doc <Type> prints the type's docs URL for the current qs version", () => { const result = spawnSync("node", [BIN, "PanelWindow"], { encoding: "utf8" }); assert.equal(result.status, 0, `stderr: ${result.stderr}`); // Must contain a quickshell.org URL matching the installed version. assert.match( result.stdout, /https?:\/\/quickshell\.org\/docs\/v\d+\.\d+\.\d+\/types\/Quickshell\/PanelWindow/, );});test("qs-doc accepts a namespaced type like Quickshell.Services.Pipewire.Pipewire", () => { const result = spawnSync( "node", [BIN, "Quickshell.Services.Pipewire.Pipewire"], { encoding: "utf8" }, ); assert.equal(result.status, 0, `stderr: ${result.stderr}`); assert.match( result.stdout, /https?:\/\/quickshell\.org\/docs\/v\d+\.\d+\.\d+\/types\/Quickshell\/Services\/Pipewire\/Pipewire/, );});test("qs-doc with --list prints type index URL", () => { const result = spawnSync("node", [BIN, "--list"], { encoding: "utf8" }); assert.equal(result.status, 0, `stderr: ${result.stderr}`); assert.match( result.stdout, /https?:\/\/quickshell\.org\/docs\/v\d+\.\d+\.\d+\/types/, );});test("qs-doc --open <Type> uses xdg-open (Linux) or platform equivalent", () => { // Just verify the --open flag is recognized (exit 0, no usage message). // We don't actually open a browser in the test (no display guarantee). const result = spawnSync("node", [BIN, "PanelWindow", "--print"], { encoding: "utf8", }); assert.equal(result.status, 0, `stderr: ${result.stderr}`); assert.match(result.stdout, /PanelWindow/);});new file mode 100644+182 / −0 text lines
// qs-scaffold.test.mjs// Run: node --test bin/test/qs-scaffold.test.mjsimport assert from "node:assert/strict";import { spawnSync } from "node:child_process";import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync,} from "node:fs";import { tmpdir } from "node:os";import { dirname, join } from "node:path";import { test } from "node:test";import { fileURLToPath } from "node:url";const __dirname = dirname(fileURLToPath(import.meta.url));const BIN = join(__dirname, "..", "qs-scaffold.mjs");function makeTmp() { const dir = mkdtempSync(join(tmpdir(), "qs-scaffold-test-")); return dir;}test("qs-scaffold creates a config dir with shell.qml from default example", () => { const tmp = makeTmp(); try { const result = spawnSync("node", [BIN, "mybar"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }); assert.equal(result.status, 0, `stderr: ${result.stderr}`); const target = join(tmp, "quickshell", "mybar"); assert.ok(existsSync(target), `target dir not created: ${target}`); assert.ok(existsSync(join(target, "shell.qml")), "shell.qml missing"); // The default example is 02-per-monitor-bar (canonical per-monitor shape). const content = readFileSync(join(target, "shell.qml"), "utf8"); assert.match(content, /Variants/); assert.match(content, /Quickshell\.screens/); } finally { rmSync(tmp, { recursive: true, force: true }); }});test("qs-scaffold with --from 01 uses 01-hello-bar", () => { const tmp = makeTmp(); try { const result = spawnSync("node", [BIN, "mybar", "--from", "01-hello-bar"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }); assert.equal(result.status, 0, `stderr: ${result.stderr}`); const shell = readFileSync( join(tmp, "quickshell", "mybar", "shell.qml"), "utf8", ); assert.match(shell, /hello quickshell/i); } finally { rmSync(tmp, { recursive: true, force: true }); }});test("qs-scaffold with --from 07-composite-bar copies Bar.qml too", () => { const tmp = makeTmp(); try { const result = spawnSync( "node", [BIN, "mybar", "--from", "07-composite-bar"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }, ); assert.equal(result.status, 0, `stderr: ${result.stderr}`); const target = join(tmp, "quickshell", "mybar"); const files = readdirSync(target); assert.ok(files.includes("shell.qml"), "shell.qml missing"); assert.ok( files.includes("Bar.qml"), "Bar.qml missing (multi-file example not fully copied)", ); } finally { rmSync(tmp, { recursive: true, force: true }); }});test("qs-scaffold touches .qmlls.ini for LSP", () => { const tmp = makeTmp(); try { const result = spawnSync("node", [BIN, "mybar"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }); assert.equal(result.status, 0, `stderr: ${result.stderr}`); assert.ok( existsSync(join(tmp, "quickshell", "mybar", ".qmlls.ini")), ".qmlls.ini missing", ); } finally { rmSync(tmp, { recursive: true, force: true }); }});test("qs-scaffold without args exits non-zero with usage", () => { const result = spawnSync("node", [BIN], { encoding: "utf8" }); assert.notEqual(result.status, 0); assert.match(result.stderr, /usage/i);});test("qs-scaffold with bad --from exits non-zero", () => { const tmp = makeTmp(); try { const result = spawnSync( "node", [BIN, "mybar", "--from", "99-does-not-exist"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }, ); assert.notEqual(result.status, 0); assert.match(result.stderr, /not found|does not exist/i); } finally { rmSync(tmp, { recursive: true, force: true }); }});test("qs-scaffold rejects a config name that escapes the config root", () => { const tmp = makeTmp(); try { const result = spawnSync("node", [BIN, "../escaped"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }); assert.notEqual(result.status, 0); assert.match(result.stderr, /single path segment/i); assert.equal(existsSync(join(tmp, "escaped")), false); } finally { rmSync(tmp, { recursive: true, force: true }); }});test("qs-scaffold rejects an example name containing path traversal", () => { const tmp = makeTmp(); try { const result = spawnSync( "node", [BIN, "mybar", "--from", "../01-hello-bar"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }, ); assert.notEqual(result.status, 0); assert.match(result.stderr, /single path segment/i); assert.equal(existsSync(join(tmp, "quickshell", "mybar")), false); } finally { rmSync(tmp, { recursive: true, force: true }); }});test("qs-scaffold with existing target dir exits non-zero (no clobber)", () => { const tmp = makeTmp(); try { const target = join(tmp, "quickshell", "mybar"); mkdirSync(target, { recursive: true }); writeFileSync(join(target, "preexisting.txt"), "do not clobber"); const result = spawnSync("node", [BIN, "mybar"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }); assert.notEqual(result.status, 0); // Preexisting file must still exist with original content. const still = readFileSync(join(target, "preexisting.txt"), "utf8"); assert.equal(still, "do not clobber"); } finally { rmSync(tmp, { recursive: true, force: true }); }});new file mode 100644+49 / −0 text lines
// qs-version.test.mjs// Run: node --test bin/test/qs-version.test.mjsimport assert from "node:assert/strict";import { spawnSync } from "node:child_process";import { dirname, join } from "node:path";import { test } from "node:test";import { fileURLToPath } from "node:url";const __dirname = dirname(fileURLToPath(import.meta.url));const BIN = join(__dirname, "..", "qs-version.mjs");test("qs-version prints version + docs URL when qs is in PATH", () => { // We rely on the system `qs` being installed (it's in /usr/bin on this box). const result = spawnSync("node", [BIN], { encoding: "utf8" }); assert.equal(result.status, 0, `stderr: ${result.stderr}`); // Output must contain "Quickshell" (or "quickshell"), a version, and a docs URL. assert.match( result.stdout, /Quickshell\s+\d+\.\d+\.\d+/i, "must print version", ); assert.match( result.stdout, /https?:\/\/quickshell\.org\/docs\/v\d+\.\d+\.\d+\//, "must print docs URL", ); // The docs URL must match the version line. const versionMatch = result.stdout.match(/(\d+\.\d+\.\d+)/); assert.ok(versionMatch, "must find a version"); assert.ok( result.stdout.includes(`/docs/v${versionMatch[1]}/`), `docs URL must include /docs/v${versionMatch[1]}/`, );});test("qs-version exit code 0 on success", () => { const result = spawnSync("node", [BIN], { encoding: "utf8" }); assert.equal(result.status, 0);});test("qs-version output is 2-3 lines", () => { const result = spawnSync("node", [BIN], { encoding: "utf8" }); const lines = result.stdout.trim().split("\n"); assert.ok( lines.length >= 2 && lines.length <= 3, `got ${lines.length} lines: ${result.stdout}`, );});new file mode 100644+13 / −0 text lines
# 01: hello barA `PanelWindow` can be the root object of `shell.qml`.This example anchors one 30-pixel panel to the top edge and renders centered text.Static check:```shqmllint -I /usr/lib/qt6/qml examples/01-hello-bar/shell.qml```Do not launch it on the real desktop merely to validate the skill.Mapped placement and appearance require separate visual acceptance in a nested compositor or explicitly approved session.new file mode 100644+22 / −0 text lines
// 01-hello-bar/shell.qml// Smallest valid Quickshell shell: one panel on the focused monitor, "hello world".// Run with: qs -p examples/01-hello-bar/shell.qmlimport QtQuickimport QuickshellPanelWindow { anchors { top: true left: true right: true } implicitHeight: 30 color: "#cc1e1e2e" Text { anchors.centerIn: parent text: "hello quickshell" color: "white" }}new file mode 100644+52 / −0 text lines
// 02-per-monitor-bar/Bar.qml// The bar component. Imported from shell.qml with `import "."`.import QtQuickimport QtQuick.Layoutsimport QuickshellPanelWindow { id: bar // Anchored to top, full-width. anchors { top: true left: true right: true } implicitHeight: 32 color: "#cc1e1e2e" // The screen is set by the Variants delegate in shell.qml. // Instantiate the clock; precision defaults to Seconds. SystemClock { id: clock precision: SystemClock.Seconds } Row { anchors.fill: parent anchors.leftMargin: 12 anchors.rightMargin: 12 spacing: 16 // Left side: workspace label (just static here; see Hyprland example for live). Text { text: "Bar" color: "white" font.pointSize: 11 anchors.verticalCenter: parent.verticalCenter } Item { width: 1 } // spacer; the Row stretches // Right side: a clock. Uses Qt.formatDateTime for formatting. Text { text: Qt.formatDateTime(clock.date, "yyyy-MM-dd hh:mm:ss") color: "white" font.pointSize: 11 anchors.verticalCenter: parent.verticalCenter } }}new file mode 100644+15 / −0 text lines
# 02: per-monitor bar`Variants` is the entry root and creates a `Bar` for each item in `Quickshell.screens`.The delegate exposes each screen as `modelData` and binds it to the panel's `screen` property.`Bar.qml` is a local PascalCase component imported by `import "."` in `shell.qml`.Check the installed guide before changing local imports to `qs.*` module imports.Static check:```shqmllint -I /usr/lib/qt6/qml examples/02-per-monitor-bar/shell.qml```Static checking does not exercise monitor hotplug or confirm one correctly placed surface per display.new file mode 100644+19 / −0 text lines
// 02-per-monitor-bar/shell.qml// Per-monitor bar: one bar per connected screen, via Variants + Quickshell.screens.// Run with: qs -p examples/02-per-monitor-bar/shell.qmlimport QtQuickimport Quickshellimport "."// Variants creates one delegate instance per item in `model`.// `modelData` is the per-iteration value; mark it `required` so qmlls catches misses.Variants { model: Quickshell.screens delegate: Component { Bar { required property var modelData screen: modelData } }}new file mode 100644+17 / −0 text lines
# 03: clock panelThis example uses `PanelWindow`, not `FloatingWindow`.`PanelWindow` provides screen-edge anchors and margins.`SystemClock.date` gives the text binding a reactive dependency.The panel anchors to the top edge and uses a calculated left margin for horizontal placement.It does not use `WlrLayershell` on a `FloatingWindow`.Static check:```shqmllint -I /usr/lib/qt6/qml examples/03-clock/shell.qml```Static checking does not prove final placement, typography, or appearance above other windows.Those require visual acceptance in an isolated compositor or explicitly approved session.new file mode 100644+55 / −0 text lines
// 03-clock/shell.qml// A floating-style clock panel: appears at top-center of the focused monitor.// Uses PanelWindow (not FloatingWindow) so we get anchors + margins + layer-shell by default.// Run with: qs -p examples/03-clock/shell.qmlimport QtQuickimport QuickshellPanelWindow { // Center horizontally via margins; no `anchors.horizontalCenter` on PanelWindow. anchors { top: true } margins { top: 60 left: (screen.width - implicitWidth) / 2 } implicitWidth: 380 implicitHeight: 90 color: "#dd1e1e2e" // Do not reserve screen space because this is an overlay, not a bar. exclusiveZone: 0 // Round corners via an inner Rectangle (PanelWindow itself can't be rounded). Rectangle { anchors.fill: parent radius: 12 color: "transparent" // fill the panel Column { anchors.centerIn: parent spacing: 4 SystemClock { id: clock precision: SystemClock.Seconds } Text { text: Qt.formatTime(clock.date, "HH:mm:ss") color: "white" font.pointSize: 28 font.bold: true anchors.horizontalCenter: parent.horizontalCenter } Text { text: Qt.formatDate(clock.date, "dddd, MMMM d") color: "#ccd0d0d0" font.pointSize: 12 anchors.horizontalCenter: parent.horizontalCenter } } }}new file mode 100644+70 / −0 text lines
// 04-pipewire-volume/Bar.qml// A bar showing the default audio sink volume. Drag the slider to change it.import QtQuickimport QtQuick.Controlsimport QtQuick.Layoutsimport Quickshellimport Quickshell.Services.Pipewireimport Quickshell.WidgetsPanelWindow { id: bar anchors { top: true; left: true; right: true } implicitHeight: 36 color: "#cc1e1e2e" readonly property var sinkAudio: Pipewire.defaultAudioSink ? Pipewire.defaultAudioSink.audio : null // Keep the default sink tracked so its audio object remains available. PwObjectTracker { objects: [ Pipewire.defaultAudioSink ] } RowLayout { anchors.fill: parent anchors.leftMargin: 12 anchors.rightMargin: 12 spacing: 12 // Icon. `Quickshell.iconPath` resolves against the system icon theme. IconImage { implicitSize: 18 source: Quickshell.iconPath( bar.sinkAudio && bar.sinkAudio.muted ? "audio-volume-muted-symbolic" : "audio-volume-high-symbolic" ) } // Mute toggle. The `Connections` watches the service for changes. Text { text: "Mute" color: "white" font.pointSize: 11 MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor onClicked: if (bar.sinkAudio) bar.sinkAudio.muted = !bar.sinkAudio.muted } } Item { Layout.fillWidth: true; Layout.preferredWidth: 1 } // spacer // Service changes update the slider through the value binding. // User movement writes back through onMoved without reacting to initialization. Slider { Layout.preferredWidth: 240 from: 0 to: 1.5 value: bar.sinkAudio ? bar.sinkAudio.volume : 0 onMoved: if (bar.sinkAudio) bar.sinkAudio.volume = value } Text { text: `${Math.floor((bar.sinkAudio ? bar.sinkAudio.volume : 0) * 100)}%` color: "white" font.pointSize: 11 Layout.preferredWidth: 40 } }}new file mode 100644+14 / −0 text lines
# 04: PipeWire volumeThis example tracks the default audio sink, displays its state, and binds a slider to its volume.The slider writes back only from `onMoved`, so initialization and service-driven updates do not cause writes.The write checks that the audio object exists.Static check:```shqmllint -I /usr/lib/qt6/qml examples/04-pipewire-volume/shell.qml```This does not exercise PipeWire discovery or volume mutation.A runtime service test needs an isolated PipeWire environment and explicit interaction assertions.new file mode 100644+19 / −0 text lines
// 04-pipewire-volume/shell.qml// A bar with the default sink's volume, read and written via PwObjectTracker and Slider.// Run with: qs -p examples/04-pipewire-volume/shell.qmlimport QtQuickimport QtQuick.Layoutsimport Quickshellimport Quickshell.Services.Pipewireimport "."Variants { model: Quickshell.screens delegate: Component { Bar { required property var modelData screen: modelData } }}new file mode 100644+21 / −0 text lines
# 05: volume OSDThis example follows the structural OSD pattern:- `Scope` groups the non-visual objects under one reload scope.- `Connections` reacts to changes from the current default sink audio object.- `Timer` controls visibility duration.- `LazyLoader` creates the window only while needed.- `PanelWindow` provides anchored layer-shell placement.- an empty `Region` makes the surface click-through.It does not use `FloatingWindow` with `WlrLayershell`.Static check:```shqmllint -I /usr/lib/qt6/qml examples/05-osd-volume/shell.qml```Do not trigger the real session's audio service during routine validation.Appearance, timing, click-through behavior, and service reaction require separate isolated interaction and visual checks.new file mode 100644+109 / −0 text lines
// 05-osd-volume/shell.qml// OSD volume: appears for 1s when the default sink's volume changes.// Pattern: Scope (shared state) + Connections (signal) + Timer (debounce) + LazyLoader (memory-aware) + PanelWindow (default layer).// Run with: qs -p examples/05-osd-volume/shell.qml// Try: `wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.5` in another terminal to trigger.import QtQuickimport QtQuick.Layoutsimport Quickshellimport Quickshell.Services.Pipewireimport Quickshell.WidgetsScope { id: root readonly property var sinkAudio: Pipewire.defaultAudioSink ? Pipewire.defaultAudioSink.audio : null // Keep the default sink tracked. The Connections below needs it to be live. PwObjectTracker { objects: [ Pipewire.defaultAudioSink ] } // Show OSD for 1s after every volume change. Connections { target: root.sinkAudio function onVolumeChanged() { root.shouldShowOsd = true hideTimer.restart() } function onMutedChanged() { root.shouldShowOsd = true hideTimer.restart() } } property bool shouldShowOsd: false Timer { id: hideTimer interval: 1000 onTriggered: root.shouldShowOsd = false } // LazyLoader: only exists when shouldShowOsd. Frees memory between events. // PanelWindow, not FloatingWindow, provides layer-shell placement. LazyLoader { active: root.shouldShowOsd PanelWindow { // The compositor picks the current focused monitor when no screen is set. anchors.bottom: true margins.bottom: screen.height / 5 exclusiveZone: 0 implicitWidth: 400 implicitHeight: 60 color: "transparent" // Empty region = click-through. Clicks pass to whatever's behind. mask: Region {} Rectangle { anchors.fill: parent radius: height / 2 color: "#aa000000" RowLayout { anchors { fill: parent leftMargin: 14 rightMargin: 18 } spacing: 12 IconImage { implicitSize: 28 source: Quickshell.iconPath( root.sinkAudio && root.sinkAudio.muted ? "audio-volume-muted-symbolic" : "audio-volume-high-symbolic" ) } Rectangle { Layout.fillWidth: true implicitHeight: 8 radius: 4 color: "#33ffffff" Rectangle { anchors { left: parent.left top: parent.top bottom: parent.bottom } implicitWidth: parent.width * Math.min(1, root.sinkAudio ? root.sinkAudio.volume : 0) radius: 4 color: "white" } } Text { text: `${Math.floor((root.sinkAudio ? root.sinkAudio.volume : 0) * 100)}%` color: "white" font.pointSize: 13 Layout.preferredWidth: 50 } } } } }}new file mode 100644+24 / −0 text lines
# 06: IPC controlThis example exposes explicitly typed functions through `IpcHandler`.The handler target is `mybar`.After starting the configuration in an isolated runtime, inspect and call it with the installed CLI:```shqs ipc showqs ipc call mybar showqs ipc call mybar hideqs ipc call mybar toggleqs ipc call mybar setText "hello"````IpcHandler` signals are observed with `qs ipc wait` or `qs ipc listen` when supported by the installed version.They are not consumed through an invented cross-process `IpcHandler.ipcBus` object.The installed `qmllint` may not handle dynamically declared, explicitly typed `IpcHandler` functions.A non-zero result without diagnostics is not proof that the example is invalid or valid.Cross-check the exact function syntax against the installed `IpcHandler` type page,then use an isolated load and IPC test.Static checking does not prove IPC registration or calls.new file mode 100644+40 / −0 text lines
// 06-ipc-control/shell.qml// IpcHandler: expose show/hide/toggle/text functions callable from outside the shell.// Run with: qs -p examples/06-ipc-control/shell.qml// Try:// qs -c ... ipc call mybar show// qs -c ... ipc call mybar hide// qs -c ... ipc call mybar toggle// qs -c ... ipc call mybar setText "hello from outside"import QtQuickimport Quickshellimport Quickshell.IoScope { id: root property string label: "idle" IpcHandler { target: "mybar" // IPC namespace for qs ipc call function show(): void { bar.visible = true } function hide(): void { bar.visible = false } function toggle(): void { bar.visible = !bar.visible } function setText(s: string): void { root.label = s } } PanelWindow { id: bar visible: false anchors { top: true; left: true; right: true } implicitHeight: 40 color: "#cc1e1e2e" Text { anchors.centerIn: parent text: root.label color: "white" } }}new file mode 100644+67 / −0 text lines
// 07-composite-bar/Bar.qmlimport QtQuickimport QtQuick.Layoutsimport Quickshellimport Quickshell.Services.Pipewireimport Quickshell.Services.UPowerimport Quickshell.Hyprlandimport Quickshell.WidgetsPanelWindow { id: bar anchors { top: true; left: true; right: true } implicitHeight: 36 color: "#cc1e1e2e" readonly property var sinkAudio: Pipewire.defaultAudioSink ? Pipewire.defaultAudioSink.audio : null // Keep Pipewire nodes alive for state binding. PwObjectTracker { objects: [ Pipewire.defaultAudioSink ] } SystemClock { id: clock; precision: SystemClock.Seconds } RowLayout { anchors.fill: parent anchors.leftMargin: 12 anchors.rightMargin: 12 spacing: 16 // Left: Hyprland workspace indicator (live from Hyprland IPC). Text { color: "white" font.pointSize: 11 text: Hyprland.focusedWorkspace ? `${Hyprland.focusedWorkspace.id}` : "?" } Item { Layout.fillWidth: true } // Center: SystemClock live time. Text { color: "white" font.pointSize: 11 text: Qt.formatDateTime(clock.date, "HH:mm:ss") } Item { Layout.fillWidth: true } // Right cluster: battery + volume. Text { color: "white" font.pointSize: 11 text: UPower.displayDevice ? `${Math.floor(UPower.displayDevice.chargePercentage * 100)}%` : "n/a" } IconImage { implicitSize: 16 source: Quickshell.iconPath( bar.sinkAudio && bar.sinkAudio.muted ? "audio-volume-muted-symbolic" : "audio-volume-high-symbolic" ) } Text { color: "white" font.pointSize: 11 text: `${Math.floor((bar.sinkAudio ? bar.sinkAudio.volume : 0) * 100)}%` } }}new file mode 100644+14 / −0 text lines
# 07: composite barThis example combines a per-screen panel with `SystemClock`, PipeWire, UPower, and the Hyprland module.It is intentionally compositor-specific because it imports `Quickshell.Hyprland`.Do not claim that the Hyprland workspace binding is a generic Sway, i3, or Niri interface.Static check:```shqmllint -I /usr/lib/qt6/qml examples/07-composite-bar/shell.qml```Static checking only establishes that the installed imports and QML structure resolve.Service values, workspace updates, per-screen placement, and appearance require isolated runtime and visual checks.new file mode 100644+22 / −0 text lines
// 07-composite-bar/shell.qml// Composite: per-monitor bar combining Variants, SystemClock, Pipewire, UPower, Hyprland.// Real-world "give me one of every module on my bar" stress test.// Run with: qs -p examples/07-composite-bar/shell.qmlimport QtQuickimport QtQuick.Layoutsimport Quickshellimport Quickshell.Services.Pipewireimport Quickshell.Services.UPowerimport Quickshell.Hyprlandimport Quickshell.Widgetsimport "."Variants { model: Quickshell.screens delegate: Component { Bar { required property var modelData screen: modelData } }}new file mode 100644+21 / −0 text lines
# 08: minimal notification daemonThis example tracks notifications and renders plain summary and body text.It explicitly disables action, persistence, inline-reply, markup, hyperlink, and image capability flags because the UI does not implement them.For a positive `expireTimeout`, which the installed-version docs express in seconds, the example converts to milliseconds for QML `Timer.interval` and calls `Notification.expire()`.Zero leaves the notification visible; a negative timeout requests daemon policy, here five seconds.Each window owns its expiry timer, so removing the notification also removes its timer.`Variants` creates the windows; a Qt Quick `Repeater` cannot use non-Item window delegates.This example has no history, manual dismissal, overflow management, or multi-monitor policy and is not a production daemon.Static check:```shqmllint -I /usr/lib/qt6/qml examples/08-notification-daemon/shell.qml```**Do not launch this against the user's real session during routine validation.**`NotificationServer` attempts to own the session notification service.A runtime test requires an isolated session bus and notification clients.Static checking does not prove ownership, expiry, stacking, interaction, or appearance.new file mode 100644+90 / −0 text lines
// Minimal plain-text notification example, not a production daemon.// Run only with an isolated session bus and nested compositor.pragma ComponentBehavior: Boundimport QtQuickimport Quickshellimport Quickshell.Services.NotificationsScope { NotificationServer { id: server actionsSupported: false bodyMarkupSupported: false persistenceSupported: false bodyHyperlinksSupported: false bodyImagesSupported: false inlineReplySupported: false onNotification: notification => notification.tracked = true } // Variants can instantiate windows; Repeater delegates must be Items. Variants { model: server.trackedNotifications delegate: Component { PanelWindow { id: popup required property var modelData anchors { bottom: true right: true } margins { bottom: 30 + server.trackedNotifications.values.indexOf(popup.modelData) * 88 right: 16 } exclusiveZone: 0 implicitWidth: 360 implicitHeight: 80 color: "transparent" mask: Region {} // Quickshell uses seconds: zero persists, negative requests daemon policy. Timer { interval: popup.modelData.expireTimeout > 0 ? popup.modelData.expireTimeout * 1000 : 5000 running: popup.modelData.expireTimeout !== 0 repeat: false onTriggered: popup.modelData.expire() } Rectangle { anchors.fill: parent radius: 8 color: "#dd1e1e2e" border.color: "#444" border.width: 1 Column { anchors.fill: parent anchors.margins: 12 spacing: 4 Text { text: popup.modelData.summary textFormat: Text.PlainText color: "white" font.pointSize: 12 font.bold: true elide: Text.ElideRight width: parent.width } Text { text: popup.modelData.body textFormat: Text.PlainText color: "#ccc" font.pointSize: 10 elide: Text.ElideRight width: parent.width visible: text.length > 0 } } } } } }}new file mode 100644+26 / −0 text lines
# Quickshell examplesThese examples demonstrate small configuration shapes.Before adapting one, resolve the installed Quickshell version and check its official type pages.| Example | Demonstrates || ------------------------ | ------------------------------------------------------------------------------- || `01-hello-bar` | A `PanelWindow` as the entry root || `02-per-monitor-bar` | A `Variants` root and one panel per screen || `03-clock` | A top-anchored clock panel || `04-pipewire-volume` | Tracked PipeWire state and reactive slider binding || `05-osd-volume` | `Scope`, `Connections`, `Timer`, `LazyLoader`, and `PanelWindow` || `06-ipc-control` | Explicitly typed `IpcHandler` functions || `07-composite-bar` | Several installed services in one panel || `08-notification-daemon` | Plain notification summary/body rendering without unsupported capability claims |## Validation boundaryUse `qmllint` for static structure and imports.Do not launch these examples on the user's real desktop merely to validate the skill.A panel maps a desktop surface, and the notification example attempts to own the session notification service.Runtime checks require a nested compositor and isolated runtime and service state.Interaction and visual acceptance are separate from static or offscreen loading.The authentication and lockscreen APIs are intentionally not represented by runnable examples here because routine validation must not start live authentication or session-lock flows.new file mode 100644+6 / −0 text lines
new file mode 100644+62 / −0 text lines
# Getting fresh Quickshell documentationQuickshell APIs change between releases.Resolve the installed version before designing or changing a component.## 1. Identify the installed version```shqs --version```Use the exact reported version in official URLs:- Guide: `https://quickshell.org/docs/v<version>/guide/`- Type index: `https://quickshell.org/docs/v<version>/types/`- Changelog: `https://quickshell.org/changelog/`## 2. Inspect each type usedFor every Quickshell type, verify:- import module- creatable versus singleton status- properties and their units- signals and handler parameters- invokable methods- platform or protocol restrictionsDo not infer one service's shape from another service.Do not preserve a guessed fallback API for older versions.Target the installed version unless the user explicitly requests multiple versions.## 3. Resolve local and web disagreementThe installed module describes what the local binary exposes.On a typical Qt 6 Linux installation, inspect:```text/usr/lib/qt6/qml/Quickshell/**/qmldir/usr/lib/qt6/qml/Quickshell/**/*.qmltypes```Use the equivalent QML import directory on other systems.`*.qmltypes` establishes names, properties, signals, methods, and enums,but prose docs remain necessary for semantics such as units and lifecycle.## 4. Cross-check official examplesUse the official examples repository only when the guide and type pages are insufficient.Call the `git_clone_safe` tool with URL `https://github.com/quickshell-mirror/quickshell-examples` and an isolated destination.Do not invoke it as a shell command.Read the example nearest to the requested component.Do not treat community configuration files as API documentation because they may target another Quickshell revision.## 5. Record evidence honestly`qmllint` provides static evidence only.An offscreen Quickshell load provides load evidence only.Neither proves mapped surfaces, input, compositor behavior, or service integration.Runtime service checks require an isolated D-Bus and service environment.Visual and interaction acceptance require a nested compositor or an explicitly approved target session.new file mode 100644+32 / −0 text lines
# Installation and packagingPackage availability and build dependencies change.Use the install guide matching the desired Quickshell release:```texthttps://quickshell.org/docs/v<version>/guide/install-setup/```For an existing machine, inspect before changing anything:```shqs --versionqs --help```Prefer the distribution's supported package path unless the user asks for a source build or another packaging model.Do not add blanket package pinning, source-build scaffolding, compatibility branches, or version gates.If multiple versions are an explicit requirement, define the supported versions and test each one.## Editor setupFollow the installed guide for `qmlls` setup.A `.qmlls.ini` file contains machine-specific paths and should not be copied as portable configuration.## Troubleshooting order1. Capture the exact `qs` version and full diagnostic output.2. Verify the QML import paths and installed modules.3. Check the matching official type page for every unresolved symbol.4. Distinguish a static or load failure from a mapped-surface, compositor-protocol, or service failure.5. Reproduce runtime behavior only in an isolated environment when the configuration can claim desktop protocols or services.new file mode 100644+150 / −0 text lines
# Retained patternsVerify every Quickshell type against the installed-version docs before using these patterns.These examples show structure, not cross-version compatibility.## Single panel rootA `PanelWindow` can be the entry file's root object.It does not need a `ShellRoot` wrapper.```qmlimport QtQuickimport QuickshellPanelWindow { anchors { top: true; left: true; right: true } implicitHeight: 30 Text { anchors.centerIn: parent; text: "hello" }}```## One panel per screenA `Variants` object can also be the entry root.```qmlimport QtQuickimport QuickshellVariants { model: Quickshell.screens delegate: Component { PanelWindow { required property var modelData screen: modelData } }}````required property var modelData` exposes the model item to the delegate.## Reactive clock```qmlSystemClock { id: clock precision: SystemClock.Seconds}Text { text: Qt.formatTime(clock.date, "HH:mm:ss")}```The binding updates when `clock.date` changes.A direct `new Date()` expression has no changing QML dependency.## Process output```qmlimport Quickshell.IoProcess { command: ["some-program", "--argument"] running: true stdout: StdioCollector { onStreamFinished: output.text = this.text }}```Pass command arguments as a list.Do not invoke a shell unless shell syntax is explicitly required and trusted.For line-oriented output, use `SplitParser` and its `onRead` signal after verifying the installed type page.## Service-backed sliderAssuming the containing object declares`readonly property var sinkAudio: Pipewire.defaultAudioSink ? Pipewire.defaultAudioSink.audio : null`:```qmlSlider { value: sinkAudio ? sinkAudio.volume : 0 onMoved: if (sinkAudio) sinkAudio.volume = value}```The `value` binding keeps external service changes reactive.`onMoved` limits writes to user movement instead of reacting to initialization or service-driven updates.## Changing signal target```qmlConnections { target: sinkAudio function onVolumeChanged() { showVolumeOsd() }}```Bind `target` to the current service object because the object may appear, disappear, or be replaced.## Conditional non-Item object```qmlLazyLoader { active: shouldShow PanelWindow { /* content */ }}```Use `LazyLoader` for a conditionally instantiated window.Use ordinary `visible` when retaining the object is intentional.## Click-through panel```qmlPanelWindow { color: "transparent" mask: Region {}}```An empty `Region` makes the window's input mask empty.Confirm interaction in a nested compositor because static loading cannot prove click-through behavior.## IPC callable```qmlimport Quickshell.IoIpcHandler { target: "mybar" function toggle(): void { panel.visible = !panel.visible }}```IPC function argument and return types must be explicit and supported by the installed version.Inspect registered handlers with `qs ipc show`, then call the function with `qs ipc call mybar toggle`.## Multi-file configurationNeighboring PascalCase QML files can define local types.For subdirectories, follow the installed guide's `qs.*` import rules.Do not add compatibility imports or version gates unless the user explicitly requires multiple Quickshell versions.new file mode 100644+78 / −0 text lines
# Resources and I/OVerify these APIs against the installed-version type pages before using them.## Paths- `Qt.resolvedUrl("asset.png")` resolves relative to the current QML file.- `Quickshell.cachePath(...)`, `dataPath(...)`, and `statePath(...)` return shell-specific paths when exposed by the installed version.- `Quickshell.env("NAME")` reads an environment variable.Choose cache, data, and state according to XDG semantics.Do not claim that a path helper itself persists QML properties.## Icons```qmlimport Quickshell.WidgetsIconImage { source: Quickshell.iconPath("audio-volume-high-symbolic") implicitSize: 24}```Check the installed `Quickshell.iconPath` overloads before adding fallback behavior.An icon name still depends on the active icon theme.## FileView and JsonAdapter`JsonAdapter` is an adapter owned by `FileView`.It does not have a `path` property and does not infer arbitrary properties from a JSON file.Declare the adapter properties explicitly.```qmlimport Quickshell.IoFileView { path: Qt.resolvedUrl("config.json") watchChanges: true onFileChanged: reload() JsonAdapter { property string accent: "blue" }}```Read the installed `FileView` and `JsonAdapter` pages before enabling writes.Writing configuration requires an explicit save policy and data-loss handling.## Reload state`PersistentProperties` carries declared properties across a Quickshell configuration reload.It does not provide durable persistence across process restarts.Use its documented `reloadableId` behavior and do not describe it as disk storage.## IPC`IpcHandler` exposes explicitly typed functions, properties, and signals through `qs ipc`.```qmlimport Quickshell.IoIpcHandler { target: "mybar" function setText(value: string): void { label.text = value } signal changed(value: string)}```- Inspect registrations with `qs ipc show`.- Call functions with `qs ipc call mybar setText "value"`.- Observe exported signals with the installed CLI's `qs ipc wait` or `qs ipc listen` commands.- Do not invent an `IpcHandler.ipcBus` singleton or use `Connections` as cross-process IPC.Function argument and return types must be explicit and supported by the installed version.new file mode 100644+90 / −0 text lines
# Services**Service APIs are version-sensitive and can mutate the user's session.**Start from the installed-version type index, not from a remembered recipe.Inspect local `*.qmltypes` files when the installed module and web docs may differ.## PipeWireThe retained default-sink shape is:```qmlimport QtQuickimport Quickshellimport Quickshell.Services.PipewirePanelWindow { id: root anchors { top: true; left: true; right: true } implicitHeight: 30 readonly property var sinkAudio: Pipewire.defaultAudioSink ? Pipewire.defaultAudioSink.audio : null PwObjectTracker { objects: [Pipewire.defaultAudioSink] } Text { anchors.centerIn: parent text: `${Math.floor((root.sinkAudio ? root.sinkAudio.volume : 0) * 100)}%` }}```For a slider, keep the service-to-control binding declarative and write only user movement:```qmlSlider { value: root.sinkAudio ? root.sinkAudio.volume : 0 onMoved: if (root.sinkAudio) root.sinkAudio.volume = value}```Verify the tracker and node properties against the installed PipeWire module before extending this shape.## NotificationsCreating `NotificationServer` attempts to become the session notification daemon.Do not run it alongside the user's real notification daemon during tests.Capability properties advertise behavior to clients.Set `actionsSupported`, `persistenceSupported`, `inlineReplySupported`, markup, hyperlinks, images, or action icons to true only when the UI implements that behavior.Receiving a property from `Notification` does not mean the daemon implements its presentation or interaction.A received notification must be marked `tracked` in `onNotification` if it should remain in `trackedNotifications`.`Notification.expireTimeout` is expressed in seconds in the installed-version docs checked for this skill.Use `expire()` for timeout expiry and `dismiss()` for an explicit user dismissal because they report different close reasons.Re-check these semantics for the installed version.The bundled notification example intentionally renders only plain summary and body text.It does not advertise actions, persistence, inline reply, markup, hyperlinks, or images.## PAMNever send the PAM prompt text back as the response.The prompt is display state.The response comes from the user's input and may be sent only while `responseRequired` is true.Honor `responseVisible` when deciding whether user input may be shown.Do not use an abbreviated PAM recipe for a lockscreen.Read the complete installed-version `PamContext` page and official lockscreen example.Do not run live PAM or lockscreen checks during routine skill validation.## greetd and PolkitThese components participate in authentication and session authorization.Do not guess method names, lifecycle order, or response objects.Use the installed-version type pages and official examples.Test only in an isolated environment with a recovery path.## MPRIS, system tray, UPower, Bluetooth, and networkingLook up the installed module name and exported types before importing them.Module names and singleton shapes are not uniform across these services.If the installed API cannot support a requested feature, report the blocker.Do not silently delete requested behavior or add guessed adapters and compatibility branches.## Runtime isolationA nested compositor alone does not isolate D-Bus or per-user services.For service tests, isolate the runtime directory, session bus, and relevant service daemons as well.Static `qmllint` and offscreen loading do not validate service ownership, events, or interaction.new file mode 100644+78 / −0 text lines
# WindowingRead the installed-version type page for each window and attached property before coding.## PanelWindowUse `PanelWindow` for a decorationless surface attached to screen edges.It can be the root object of `shell.qml`.```qmlimport QuickshellPanelWindow { anchors { top: true; left: true; right: true } implicitHeight: 30 margins { top: 4; left: 4; right: 4 }}```Opposite anchors force the corresponding dimension to span the screen between margins.The exclusion zone only takes effect with the anchor combinations documented by the installed `PanelWindow` type page.For click-through rendering:```qmlPanelWindow { color: "transparent" mask: Region {}}```## FloatingWindowUse `FloatingWindow` for an ordinary desktop window controlled by the window manager.Do not use panel anchors or `WlrLayershell` on it.```qmlimport QuickshellFloatingWindow { width: 600 height: 400}```## PopupWindowUse `PopupWindow` only when the popup is anchored to another Quickshell window.Its anchor API is version-sensitive, so read the installed `PopupWindow` and `PopupAnchor` pages rather than copying a recipe from this skill.## Layer shell`WlrLayershell` is an attached object on `PanelWindow`.It is not attached to `FloatingWindow`.```qmlimport Quickshellimport Quickshell.WaylandPanelWindow { WlrLayershell.layer: WlrLayer.Overlay WlrLayershell.namespace: "my-osd"}```Layer-shell support depends on the compositor protocol, not on a blanket "Wayland" or "wlroots" label.Niri is not wlroots-based.i3 is an X11 window manager; Sway is its Wayland counterpart.Verify the target compositor's protocol support independently.## Session lock`WlSessionLock` and `WlSessionLockSurface` are security-sensitive protocol objects.Do not derive a lockscreen from an abbreviated recipe.Use the official example matching the installed Quickshell version and review the complete PAM conversation.Never launch a lockscreen or authentication flow on the real session during routine validation.Use a nested compositor and isolated authentication setup with an explicit recovery path.deleted file mode 100644+0 / −84 text lines
---name: archlinuxos: lnxdescription: "Use for Arch Linux system help: configuring the OS, pacman/package management, upgrades, maintenance, AUR/PKGBUILD/makepkg, boot/service/package/software troubleshooting. Not Raspberry Pi or generic Linux unless Arch-specific."---# Arch LinuxArch-specific system/config/troubleshooting/pkg help.Confirm Arch via `/etc/os-release`; `pacman` alone is not proof.Keep volatile facts out of memory; fetch current docs.## Route- System/maintenance/upgrade → `references/system.md`- Config changes/mirrors/hooks → `references/config.md`- Troubleshooting failures → `references/troubleshooting.md`- Software/pkg/AUR/build issues → `references/software.md`## Fresh TruthLocal first:```shman pacman pacman.conf makepkg PKGBUILD alpm-hooks paccache pacdiff```Web when local docs missing/stale:```texthttps://man.archlinux.org/man/<page>.<section>.enhttps://wiki.archlinux.org/title/<Topic>https://archlinux.org/news/https://archlinux.org/packages/https://aur.archlinux.org/```Before upgrade advice, check Arch News.For exact package/repo/current syntax, use current man/wiki/package pages, not memory.## Local WikiIf offline/frequent Arch work, check:```shpacman -Qq arch-wiki-docs arch-wiki-lite wikiman 2>/dev/null```If absent, suggest installing one.Do not require it.## Safety- No partial upgrades. Avoid `pacman -Sy <pkg>`; use full upgrade flow.- If `-Sy` happened and `-Su` failed: resolve + complete upgrade before other pkg ops.- AUR = untrusted user content. Inspect `PKGBUILD`, `*.install`, patches before build.- `.pacnew`/`.pacsave` need manual merge; never blind overwrite.- Avoid unless current Arch News/wiki explicitly says so: `--overwrite`, `-Rdd`, `--nodeps`, blind `--noconfirm`.- Do not symlink libraries to fix soname errors; complete/recover upgrade.## Root DelegationDo not run root/admin mutations yourself.Follow [linux](../linux/SKILL.md) for system boundaries and human-run escalation, even when the user authorizes the change.Give exact command for user to run.Detect user's shell first for syntax compatibility:```shprintf 'SHELL=%s\n' "$SHELL"getent passwd "$(id -un)" | cut -d: -f7```Command style:- unknown/fish/nu → one simple command per line; avoid arrays, functions, process substitution, brace expansion.- env vars → use `env VAR=value command` for portability.- complex flow → write tiny script or split steps.- state impact + rollback/log path before mutating `/etc`, pacman DB, boot, services.deleted file mode 100644+0 / −9 text lines
deleted file mode 100644+0 / −72 text lines
# Arch ConfigUse for `/etc`, pacman config, repos, mirrors, hooks, service/package config.## Before ChangingClassify:- file path- owning package- live reload/restart needed?- backup/rollback path- root required?Read-only probes:```shpacman -Qo /path/to/filepacman -Qii packagesystemctl cat unit.servicesystemctl status unit.service --no-pager```If root edit needed, delegate via user's shell.Prefer editor-safe command, e.g. `sudoedit /etc/file` when appropriate.## Pacman ConfigCurrent truth:`man pacman.conf`, wiki `Pacman`.Stable rules:- Main config: `/etc/pacman.conf`.- Mirror list commonly included from `/etc/pacman.d/mirrorlist`.- Repository order matters when packages share names.- Directives are case-sensitive/CamelCase.- `NoUpgrade`/`NoExtract` paths are archive paths: no leading `/`.- Hooks are non-interactive; system hooks live under `/usr/share/libalpm/hooks/`, admin hooks commonly under `/etc/pacman.d/hooks/`.- Signature policy/current defaults: verify with `man pacman.conf`, do not weaken casually.## Mirrors/ReposFor stale/404/target-not-found problems, inspect:```shgrep -v '^#' /etc/pacman.confgrep -v '^#' /etc/pacman.d/mirrorlist | head```Use current wiki `Mirrors`/`Reflector` before recommending tooling.After repo config changes, full upgrade before installing new packages.## Service/Software Config- Check package docs + Arch Wiki page for that software.- Check ownership before editing generated/package-owned files.- Prefer drop-ins over modifying unit files directly.- State reload command separately: e.g. daemon reload, service restart, app reload.## Current Sources- Man: `pacman.conf(5)`, `alpm-hooks(5)`, `pacman(8)`- Wiki: `Pacman`, `Mirrors`, target software pagedeleted file mode 100644+0 / −87 text lines
# Arch SoftwareUse for pacman, packages, AUR, PKGBUILD, makepkg, app install/build issues.## Pacman Query Map```shpacman -Ss term # sync DB searchpacman -Si package # sync pkg infopacman -Qs term # installed searchpacman -Qi package # installed pkg infopacman -Ql package # installed filespacman -Qo /path/file # file ownerpacman -Qm # foreign/local/AURpacman -Qtdq # orphan depspacman -F path # remote file owner; needs files DB```Refresh files DB only when needed:`pacman -Fy`.## Install/Remove- Install from repos: `pacman -S package` if DB current; otherwise full upgrade flow.- Full upgrade: `pacman -Syu`.- Install local pkg: `pacman -U ./pkg.pkg.tar.zst`.- Remove package + unneeded deps: `pacman -Rs package`.- Avoid `-Rsc`, `-Rdd`, `--nodeps`, `--overwrite` unless explicitly justified.- Use `--print`/`--print-format` for dry/processable transaction previews.## AURAUR is unsupported/untrusted user content.Agent must inspect before build/install:```shless PKGBUILDls -lagit diff @~..@ # if updating existing clone```Check for:- unexpected network/code exec in build funcs- dangerous `install` scripts- checksum/PGP handling- bundled patches- dependency sanityBuild rules:- `base-devel` is assumed by AUR packages.- Run `makepkg` as normal user, never root.- `makepkg -s` can install repo deps via pacman; AUR deps need separate handling.- `makepkg --verifysource` checks sources without building.- `makepkg --printsrcinfo` for metadata.- Clean chroot helps distinguish user-env failure from broken PKGBUILD.AUR helpers do not remove review duty.## PKGBUILD FactsCurrent truth:`man PKGBUILD`, `man makepkg`.Durable basics:- PKGBUILD is Bash sourced by `makepkg`; treat as executable code.- Minimal fields include `pkgname`, `pkgver`, `pkgrel`, `arch`.- `package()` installs into `$pkgdir`; `prepare()`, `build()`, `check()` optional.- `backup=()` controls pacnew/pacsave behavior for config files.- `source=()` + checksums/PGP define source verification.- Split packages use multiple `pkgname`s and `package_name()` funcs.## Current Sources- Man: `pacman(8)`, `makepkg(8)`, `PKGBUILD(5)`, `makepkg.conf(5)`- Wiki: `Pacman`, `Arch User Repository`, `Creating packages`, `Makepkg`- Live: `archlinux.org/packages`, `aur.archlinux.org`deleted file mode 100644+0 / −59 text lines
# Arch SystemUse for system state, maintenance, upgrades, health.## First Read-only Probes```shcat /etc/os-releaseuname -apacman -Q pacman 2>/dev/nullsystemctl --failedjournalctl -b --no-pager -p warning..alertpacman -Qmpacman -Qtdq```Do not infer Arch from `pacman` alone; read `/etc/os-release`.## Upgrade Discipline- Read `https://archlinux.org/news/` before upgrade guidance.- Full upgrades only: `pacman -Syu`.- Never advise `pacman -Sy <pkg>`.- Keep rescue/live media in mind for risky kernel/boot/glibc/systemd updates.- After upgrade: review pacman output, handle `.pacnew`, restart affected services or reboot.- AUR/local packages are user's responsibility; rebuild when deps/ABI change.## Maintenance Checks```shsystemctl --failedjournalctl -b --no-pagerpacman -Qtdq # orphan depspacman -Qm # foreign/local/AUR packagespacman -Qkk # file integrity; can be noisy```Package cache:- Prefer `paccache` from `pacman-contrib` over aggressive `pacman -Scc`.- Preserve rollback ability unless disk pressure is real.Config drift:```shfind /etc -name '*.pacnew' -o -name '*.pacsave'grep -E '\.pac(new|save)' /var/log/pacman.log```Use `pacdiff` if present.## Current Sources- Wiki: `System maintenance`, `Pacman`, `Pacman/Pacnew and Pacsave`- Man: `pacman(8)`, `paccache(8)`, `pacdiff(8)`deleted file mode 100644+0 / −97 text lines
# Arch TroubleshootingUse for boot, service, package transaction, upgrade, and app failures.Start read-only.Identify last change.## Baseline```shcat /etc/os-releaseuname -asystemctl --failedjournalctl -b --no-pager -p err..alerttail -n 80 /var/log/pacman.log```For app issue:```shcommand -v apppacman -Qo "$(command -v app)"pacman -Qi package```If command substitution conflicts with user shell, split into two commands.## Package Transaction ErrorsLock:- Verify no pacman/makepkg/AUR helper process is running before removing lock.- Current lock path/safe handling: check wiki/man.Conflicting files:```shpacman -Qo /path/to/conflict```If unowned, investigate origin before rename/delete.Avoid `--overwrite` unless current Arch guidance says so.Target not found / retrieval failed:- Verify package exists: `archlinux.org/packages`, `pacman -Ss`, AUR if unofficial.- Check enabled repos + mirror freshness.- Do not fix with `pacman -Sy <pkg>`.Invalid/corrupt package/signature:- Check current wiki `Pacman/Package signing` + Arch News.- Suspect stale keyring, partial downloads, bad mirror only after evidence.Interrupted upgrade / broken pacman / unbootable:- Fetch current wiki `Pacman#Troubleshooting` before procedural advice.- Prefer live ISO + mount + `arch-chroot`/`--sysroot` recovery path.- Reconstruct exact failed transaction from `/var/log/pacman.log` when relevant.## Software FailuresClassify:- packaging issue? upstream bug? config? missing optional dep? partial upgrade? service sandbox? permissions?Probes:```shpacman -Qi packagepacman -Ql package | lesspacman -Qii packagejournalctl -b --user --no-pagerjournalctl -b --no-pager -u unit.service```Missing `.so` after upgrades usually means partial/incomplete upgrade orunrebuilt local/AUR package.Do not symlink libs.## Output Shape```textObserved: ...Likely cause: ...Evidence: ...Safe checks: ...User-run root step, if needed: ...Rollback/logs: ...```deleted file mode 100644+0 / −48 text lines
import assert from "node:assert/strict";import { readFileSync } from "node:fs";import { join } from "node:path";import { test } from "node:test";const root = new URL("..", import.meta.url);const files = [ "SKILL.md", "references/system.md", "references/config.md", "references/troubleshooting.md", "references/software.md",];const docs = files.map((file) => [file, readFileSync(join(root.pathname, file), "utf8")]);const all = docs.map(([, text]) => text).join("\n");test("Arch skill points at current sources before volatile advice", () => { assert.match(all, /https:\/\/archlinux\.org\/news\//); assert.match(all, /https:\/\/wiki\.archlinux\.org\/title\//); assert.match(all, /https:\/\/man\.archlinux\.org\/man\//); assert.match(all, /man pacman/);});test("partial-upgrade hazard is only documented as a warning", () => { for (const [file, text] of docs) { for (const [index, line] of text.split("\n").entries()) { if (!/pacman -Sy(\s|$|<)/.test(line)) continue; assert.match( line, /Avoid|Never|Do not|No partial|happened/, `${file}:${index + 1} must warn about pacman -Sy`, ); } }});test("AUR and dangerous pacman flags keep safety warnings", () => { assert.match(all, /AUR = untrusted|AUR is unsupported\/untrusted/); assert.match(all, /Inspect `PKGBUILD`|inspect before build\/install/); assert.match(all, /Avoid .*--overwrite/); assert.match(all, /Do not symlink libs|Do not symlink libraries/);});test("root mutation guidance delegates instead of auto-running", () => { assert.match(all, /Do not run root\/admin mutations yourself\./); assert.match(all, /\.\.\/linux\/SKILL\.md/); assert.match(all, /sudoedit \/etc\/file/);});+1 / −0 text lines
+1 / −0 text lines
+1 / −0 text lines
+2 / −1 text lines
description: "Synchronize a Git branch by fetching, rebasing onto its target, testing, and optionally pushing when publication was requested. Use for pull, sync, rebase-and-push, or branch publication requests."new file mode 100644+19 / −0 text lines
---name: git-workflowpath: .gitdescription: "Use for Git commits, branch/commit reviews, pull/sync/rebase, fast-forward integration, or authorized pushes."---# Git workflowRead the matching guide before acting, resolving links relative to this skill directory rather than the project cwd.- Commit or split selected work without pushing: [git-commit](../git-commit/SKILL.md).- Inspect pinned branches, commits, or ranges without modifying source: [git-review](../git-review/SKILL.md).- Fetch, rebase, pull, or sync a branch; push only when requested: [git-sync](../git-sync/SKILL.md).- Advance a target branch to the current commit without a merge: [git-fast-forward](../git-fast-forward/SKILL.md).Read every applicable guide when the request combines operations.Follow the chosen guide's authorization checks; routing does not authorize committing, rebasing, or publishing.In colocated Git/Jujutsu workspaces, use the VCS the user or project selected; ask if ambiguous before mutating.Use GitHub-specific skills for GitHub PR operations.+1 / −0 text lines
+1 / −0 text lines
+1 / −0 text lines
+1 / −0 text lines
new file mode 100644+18 / −0 text lines
---name: github-workflowwhich: ghdescription: "Use for GitHub issues, PR creation/review/merge, releases, comments, Actions, or repository metadata via gh when local Git data is insufficient."---# GitHub workflowRead the matching guide before acting, resolving links relative to this skill directory rather than the project cwd.- Inspect issues, releases, Actions, comments, or repository state through `gh`: [github-cli](../github-cli/SKILL.md).- Create, open, update, publish, or finish a PR: [github-pr-create](../github-pr-create/SKILL.md).- Review a PR, assess readiness, or draft or publish review feedback: [github-pr-review](../github-pr-review/SKILL.md).- Merge or integrate a PR and clean up its branch: [github-pr-merge](../github-pr-merge/SKILL.md).Read every applicable guide when the request combines operations.Follow the selected guide's authorization and verification checks; reading this router does not authorize mutation, review publication, or merge.For a Git-only revision comparison without GitHub PR state, use git-workflow instead.+1 / −0 text lines
+1 / −0 text lines
+1 / −0 text lines
+1 / −0 text lines
new file mode 100644+18 / −0 text lines
---name: jj-workflowpath: .jjdescription: "Use for Jujutsu (jj) commits, revision/bookmark reviews, pull/sync/rebase, bookmark integration, or authorized pushes."---# Jujutsu workflowRead the matching guide before acting, resolving links relative to this skill directory rather than the project cwd.- Commit or split the current change without pushing: [jj-commit](../jj-commit/SKILL.md).- Inspect pinned revisions, bookmarks, or change ranges without modifying source: [jj-review](../jj-review/SKILL.md).- Fetch, rebase, pull, or sync a stack; push only when requested: [jj-sync](../jj-sync/SKILL.md).- Advance a target bookmark to the current change and push it: [jj-bookmark-move](../jj-bookmark-move/SKILL.md).Read every applicable guide when the request combines operations.Follow the chosen guide's authorization checks; routing does not authorize committing, rebasing, moving bookmarks, or publishing.In colocated Git/Jujutsu workspaces, use the VCS the user or project selected; ask if ambiguous before mutating.deleted file mode 100644+0 / −101 text lines
---name: linux-consoleos: lnxdescription: "Use for real Linux kernel virtual console work: tty1/tty2, /dev/ttyN, Ctrl+Alt+F1 VTs, TERM=linux, getty, vconsole.conf, setfont, loadkeys, setterm, console_codes, fbcon. Not for terminal emulators, /dev/pts ptys, tmux, X11, or Wayland."---# Linux Console## ScopeUse for kernel virtual consoles only:- `/dev/ttyN`- `TERM=linux`- `tty1`, `tty2`, ...- `Ctrl+Alt+F1` / VT switching- `getty`, `vconsole.conf`, `setfont`, `loadkeys`, `setterm`, `fbcon`Do not use for:- graphical terminal emulators- `/dev/pts/*` pseudo-terminals- tmux internals- X11 / Wayland / XKB config## First ProbeIdentify the target host and VT from the user's report before probing.The agent's stdin and `TERM` describe its execution context, not necessarily the target console.Run these in the target session, or ask the user for their output there:```shttyprintf '%s\n' "$TERM"```Interpret:- Target `/dev/ttyN` + `TERM=linux` → real VT likely.- Agent `/dev/pts/N` or `not a tty` → target remains unknown; do not reject VT diagnosis.- Target `/dev/pts/N` → pty; clarify whether a separate VT is the actual target.- User reports `tty1`/`tty2` on another session/host → continue target-specific read-only diagnosis.Use `infocmp -1 linux` to inspect console capabilities; it does not detect the target.Do not send console escape sequences to the agent's terminal as a substitute for the target.Missing local man page → fetch current upstream man page.## Learn Locally FirstPrefer local truth over memory:```shman console_codes | col -bman setterm | col -bman vconsole.conf | col -bman loadkeys | col -bman keymaps | col -bman setfont | col -bman reset | col -binfocmp -1 linux```For deeper lookup:`references/research.md`.## Durable Rules- `TERM=linux` describes Linux-console capabilities via terminfo.- `clear` and `reset` differ; inspect `infocmp -1 linux`.- Linux console interprets control/escape sequences; verify in `console_codes(4)`.- Existing screen cells may need redraw after display/attribute changes.- Keymap, font, palette, and persistence scopes differ; classify first.## Change HygieneFor every proposed change, state:- target: current VT | all VTs | boot/persistent- mechanism: escape seq | terminfo | kbd tool | system config | ioctl- privilege needs: none | user permissions | root/admin | unknown until probed- rollback/reset path## Safety- Never apply X11/Wayland/XKB/niri fixes to Linux console.- Never confuse `/dev/ttyN` with `/dev/pts/N`.- Do not change keymaps/fonts/persistent config without explicit user intent.- Prefer `setterm`, `loadkeys`, `setfont`, `vconsole.conf` docs over guesses.## ReferencesRead when needed:- `references/research.md` — fresh docs, command probes, web fallbacks.- `references/model.md` — VT model, terminfo, reset/clear, screen memory.- `references/tools.md` — setterm/loadkeys/setfont/vconsole scope notes.deleted file mode 100644+0 / −77 text lines
# Model## Terms- Linux console: kernel console implementation.- Virtual console / VT: numbered console, usually `/dev/ttyN`.- pty: pseudo-terminal, usually `/dev/pts/N`; not a real VT.- `TERM=linux`: terminfo name commonly used by Linux VTs.- framebuffer console / `fbcon`: kernel console display path on many systems.## DetectionEvaluate the target session, not the agent's execution context.Strong signal from the target:```text/dev/ttyN + TERM=linux````/dev/pts/N` identifies the probed session as a pty, not the user's separate VT.Agent output of `/dev/pts/N` or `not a tty` leaves the target unknown.Confirm the target host and VT; continue remote diagnosis rather than stopping.Use exact user wording too:`tty1`, `tty2`, `virtual console`, `linux console`, `Ctrl+Alt+F1`, `getty`,`fbcon`.## Terminfo`infocmp -1 linux` shows what `clear`, `reset`, curses apps, and terminfo-awareprograms will emit.Inspect, do not assume:```shinfocmp -1 linux | grep -E 'clear|rs1|rs2|rs3|oc|op|initc|sgr0'```## Clear vs Reset`clear` normally clears/redraws screen state.`reset` reinitializes terminal state via terminfo reset strings.It may undo palette/display state.Confirm through `infocmp -1 linux` and `man reset`.## Escape Controls`console_codes(4)` is source of truth for Linux-console control sequences.Stable topics there:- control chars- ESC / CSI / OSC sequences- SGR attributes- palette controls- private Linux console sequencesAvoid hard-wiring controls unless the task explicitly needs raw escapes.Prefer terminfo-aware tools when possible.## Screen Memory`vcs(4)` documents `/dev/vcsN` and `/dev/vcsaN` screen-memory devices.They can help inspect or dump VTs.Access depends on device permissions.Prefer `setterm --dump` for simple snapshots when available.## Low-level ioctls`ioctl_console(2)` describes Linux-specific console/VT ioctls and warns they areinternal-ish.Prefer user tools unless low-level work is requested.deleted file mode 100644+0 / −58 text lines
# Research PatternIdentify the target host and VT first.Run session probes in that target session, or ask the user to run them there:```shttyprintf '%s\n' "$TERM"```The agent's pty or missing tty does not rule out a separate target VT.Inspect capabilities with `infocmp -1 linux`; terminfo lookup is not target detection.Run device probes below only on the target host.Man pages:```shman console_codes | col -bman setterm | col -bman vconsole.conf | col -bman loadkeys | col -bman keymaps | col -bman dumpkeys | col -bman showkey | col -bman setfont | col -bman reset | col -bman terminfo | col -bman vcs | col -bman ioctl_console | col -b```Useful probes:```shinfocmp -1 linux | grep -E '^(\s*(clear|rs[123]|is[123]|oc|op|initc|sgr0)=)'dumpkeys | headkbd_modefgconsole 2>/dev/nullls -l /dev/tty[0-9]* /dev/vcs* /dev/vcsa* 2>/dev/null```If local docs are missing/stale, fetch current upstream docs:- <https://man7.org/linux/man-pages/man4/console_codes.4.html>- <https://man7.org/linux/man-pages/man1/setterm.1.html>- <https://man7.org/linux/man-pages/man5/vconsole.conf.5.html>- <https://man7.org/linux/man-pages/man1/loadkeys.1.html>- <https://man7.org/linux/man-pages/man5/keymaps.5.html>- <https://man7.org/linux/man-pages/man8/setfont.8.html>- <https://man7.org/linux/man-pages/man1/clear.1.html>- <https://man7.org/linux/man-pages/man1/reset.1.html>- <https://man7.org/linux/man-pages/man5/terminfo.5.html>- <https://man7.org/linux/man-pages/man4/vcs.4.html>- <https://man7.org/linux/man-pages/man2/ioctl_console.2.html>Distro docs can explain policy/integration.Prefer upstream man pages for interfaces, distro wiki for packaging/persistencequirks.deleted file mode 100644+0 / −94 text lines
# Tools## settermUse for terminal attributes and VT-specific controls.Research:```shman setterm | col -bsetterm --help```Common scopes:- foreground/background/rendering attrs: current terminal stream- `--store`: stored defaults for reset-to-default on virtual consoles- blanking, bell, repeat, kernel messages: virtual-console-specific controlsState exact scope before changing.## loadkeys / dumpkeys / showkey / keymapsUse for kernel console keyboard maps, not XKB/X11/Wayland.Research:```shman loadkeys | col -bman keymaps | col -bman dumpkeys | col -bman showkey | col -bdumpkeys | head```Critical scope:`loadkeys` changes the kernel keymap used by virtual consoles; check local docsfor exact reach and permissions.Rollback idea:```shloadkeys --default```Verify with local docs before presenting as final rollback.## setfontUse for Linux console fonts and Unicode maps.Research:```shman setfont | col -bls /usr/share/kbd/consolefonts 2>/dev/null | head```Important:- PSF fonts are common.- Font/glyph choices can affect color availability.- `-O` can save previous font/map.- `-C` can target a console device; permissions vary.## vconsole.conf / localectl / systemd-vconsole-setupUse for boot/persistent virtual-console keyboard/font config on systemd systems.Research:```shman vconsole.conf | col -bman localectl | col -bman systemd-vconsole-setup.service | col -b```State persistence and privilege needs before editing.## Palette / colorsResearch:```shman console_codes | col -bman setterm | col -binfocmp -1 linux | grep -E 'initc|oc|op|setaf|setab'```Linux console color behavior is not the same as graphical terminal emulators.Verify palette, SGR, and reset behavior locally.deleted file mode 100644+0 / −127 text lines
---name: linux-userlandos: lnxdescription: Use when editing or diagnosing Linux user-owned configuration, XDG paths, shell environment, PATH issues, dotfiles, user systemd units, desktop/session config, caches, state dirs, or app config under HOME.---# Linux UserlandLinux config work inside the user's ownership boundary.**Boundary:** operate under `$HOME` and user managers only. If a fix needs `/etc`, `/usr`, `/var/lib`, packages, kernel settings, devices, or `sudo`, stop and use `linux` escalation.## Workflow1. Identify app/tool, config file discovery rules, and current user/session.2. Resolve XDG paths; do not hard-code `~/.config` if env overrides exist.3. Read installed docs: `man`, `--help`, app config docs in repo/package.4. Inspect current config/env/state.5. Back up before edits; make minimal change.6. Validate with app-specific parser/check command.7. Reload/restart only user-owned process/service. Provide rollback.## XDG Paths| Purpose | Env | Default || ------------------ | ----------------- | -------------------- || Config | `XDG_CONFIG_HOME` | `$HOME/.config` || Data | `XDG_DATA_HOME` | `$HOME/.local/share` || State/logs/history | `XDG_STATE_HOME` | `$HOME/.local/state` || Cache | `XDG_CACHE_HOME` | `$HOME/.cache` || Runtime sockets | `XDG_RUNTIME_DIR` | set by login/session |Probe safely:```bashprintf 'HOME=%s\nXDG_CONFIG_HOME=%s\nXDG_DATA_HOME=%s\nXDG_STATE_HOME=%s\nXDG_CACHE_HOME=%s\nXDG_RUNTIME_DIR=%s\n' \ "$HOME" "${XDG_CONFIG_HOME:-$HOME/.config}" "${XDG_DATA_HOME:-$HOME/.local/share}" \ "${XDG_STATE_HOME:-$HOME/.local/state}" "${XDG_CACHE_HOME:-$HOME/.cache}" "${XDG_RUNTIME_DIR:-}"```XDG env vars must be absolute paths to be valid.## Shell + Environment DiagnosisThe agent's tool shell may not equal the user's interactive shell. Detect before giving syntax:```bashprintf 'SHELL=%s\n' "$SHELL"getent passwd "$(id -un)" | awk -F: '{print "login_shell=" $7}'printf 'PATH=%s\n' "$PATH" | tr ':' '\n'```Startup files by shell:| Shell | Common user files | PATH/export syntax || ------- | -------------------------------------------- | ----------------------------------------- || bash | `~/.bashrc`, `~/.bash_profile`, `~/.profile` | `export NAME=value` || zsh | `~/.zshrc`, `~/.zprofile`, `~/.zshenv` | `export NAME=value` || fish | `~/.config/fish/config.fish` | `set -gx NAME value`; `fish_add_path DIR` || nushell | `~/.config/nushell/env.nu`, `config.nu` | `$env.NAME = value` |Prefer editing the shell's config file over emitting complex copy-paste snippets. If root is needed, do not craft fish/nushell sudo heredocs; use `linux` script escalation.## User systemd UnitsUser units live primarily in `$XDG_CONFIG_HOME/systemd/user` (default `~/.config/systemd/user`).Read:```bashsystemctl --user --no-pager --full list-units --failedsystemctl --user --no-pager --full status UNITsystemctl --user show UNIT -p LoadState -p ActiveState -p SubState -p Result -p ExecMainStatussystemctl --user cat UNITjournalctl --user-unit UNIT -b --no-pager --full -n 200systemd-analyze --user verify "${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user/UNIT"```After editing a user unit:```bashsystemctl --user daemon-reloadsystemctl --user status UNIT --no-pager --fulljournalctl --user-unit UNIT -b --no-pager --full -n 100```Restart only if the user asked for restart or the service was active before edit:```bashsystemctl --user restart UNIT```Use `enable --now` only when the user asked for autostart.## Safe Edit PatternFor an existing regular config file, resolve symlinks first and confirm the target is inside the authorized user-owned boundary.Edit and restore the resolved target, leaving the original symlink intact.A `cp -a` backup of a symlink copies only the link, not a content snapshot.```bashfile=$(realpath -e -- /path/to/file) || exit 1[ -f "$file" ] || exit 1backup=$(mktemp -- "$file.bak.XXXXXX") || exit 1cp -p -- "$file" "$backup" || exit 1# edit "$file"# run validator/reload# rollback if bad: cp -p -- "$backup" "$file"```Stop on resolution or backup failure; do not create a missing symlink target implicitly.Validation examples:- systemd user unit: `systemd-analyze --user verify FILE`- shell config: run the shell parser if available (`bash -n FILE`, `zsh -n FILE`); fish/nushell need shell-specific checks.- app config: use the app's documented `check`, `validate`, `doctor`, or dry-run command.## Common Mistakes| Mistake | Fix || --------------------------------- | -------------------------------------------------------- || Editing `/etc` from userland task | Stop; use `linux` escalation || Assuming bash syntax | Detect shell; prefer editing files or POSIX `sh` scripts || Ignoring XDG overrides | Resolve env/defaults first || Restarting system service | Only use `systemctl --user`; escalate otherwise || Changing config without rollback | Backup + validate + rollback command |deleted file mode 100644+0 / −8 text lines
deleted file mode 100644+0 / −57 text lines
import assert from "node:assert/strict";import { spawnSync } from "node:child_process";import { lstatSync, mkdtempSync, readFileSync, readdirSync, rmSync, symlinkSync, writeFileSync } from "node:fs";import { tmpdir } from "node:os";import { join } from "node:path";import { test } from "node:test";const doc = readFileSync(new URL("../SKILL.md", import.meta.url), "utf8");const snippet = doc.match(/## Safe Edit Pattern[\s\S]*?```bash\n([\s\S]*?)```/)[1];for (const symlink of [false, true]) { test(`backup and rollback preserve ${symlink ? "symlinked" : "regular"} config`, { skip: process.platform !== "linux" }, () => { const dir = mkdtempSync(join(tmpdir(), "linux-userland-backup-")); try { const target = join(dir, "config target"); const file = symlink ? join(dir, "config link") : target; writeFileSync(target, "original\n"); if (symlink) symlinkSync(target, file); const script = snippet .replace("/path/to/file", '"$CONFIG_FILE"') .replace('# edit "$file"', 'printf "changed\\n" > "$file"') .replace("# run validator/reload", 'test "$(cat "$backup")" = original || exit 1') .replace("# rollback if bad: ", ""); const result = spawnSync("sh", ["-eu", "-c", script], { env: { ...process.env, CONFIG_FILE: file }, encoding: "utf8", }); assert.equal(result.status, 0, result.stderr); assert.equal(readFileSync(target, "utf8"), "original\n"); assert.equal(lstatSync(file).isSymbolicLink(), symlink); const backups = readdirSync(dir).filter((name) => name.includes(".bak.")); assert.equal(backups.length, 1); assert.ok(lstatSync(join(dir, backups[0])).isFile()); } finally { rmSync(dir, { recursive: true, force: true }); } });}for (const kind of ["missing", "dangling symlink", "directory"]) { test(`refuse ${kind} without creating a backup`, { skip: process.platform !== "linux" }, () => { const dir = mkdtempSync(join(tmpdir(), "linux-userland-backup-")); try { const file = kind === "directory" ? dir : join(dir, "config"); if (kind === "dangling symlink") symlinkSync(join(dir, "missing"), file); const before = readdirSync(dir); const result = spawnSync("sh", ["-eu", "-c", snippet.replace("/path/to/file", '"$CONFIG_FILE"')], { env: { ...process.env, CONFIG_FILE: file }, encoding: "utf8", }); assert.equal(result.status, 1, result.stderr); assert.deepEqual(readdirSync(dir), before); } finally { rmSync(dir, { recursive: true, force: true }); } });}deleted file mode 100644+0 / −122 text lines
---name: linuxos: lnxdescription: Use when diagnosing Linux system issues, asking about host state, systemd/journal logs, services, boot/session problems, permissions, devices, networking, or when a task may need root escalation.---# LinuxSafe Linux diagnosis for agents without root.**Boundary:** read system state; do not mutate system config. For user-owned config under `$HOME`, also use `linux-userland`.## Non-Negotiables- No `sudo`, `su`, `doas`, `pkexec`, package manager install/remove, system-service mutation, `/etc` edits, kernel/sysctl changes, or device writes from the agent.- User-service changes follow [linux-userland](../linux-userland/SKILL.md); the system-service ban does not cover them.- Read-only probes first. Prefer commands with `--no-pager`, `--full`, bounded output, and explicit units/time ranges.- Prefer installed truth: `man`, `--help`, distro files. Web docs may not match host version.- Redact secrets from env, tokens, key files, URLs, logs, and command output.- If root is required, explain why and give a copy-paste command or script for the human to run.## Workflow1. Classify: user config? → `linux-userland`. system state/root/service/device/package? → continue here.2. Inventory host facts before hypotheses.3. Inspect installed docs for exact command/config behavior.4. Gather bounded logs/status.5. State root cause confidence + evidence. If changing system state is needed, escalate to human.## Read-Only Inventory```bashuname -acat /etc/os-releaseidprintf 'SHELL=%s\n' "$SHELL"getent passwd "$(id -un)"systemctl --version 2>/dev/null || trueloginctl show-user "$(id -un)" 2>/dev/null || true```## Installed Documentation```bashMANWIDTH=100 MANPAGER=cat man systemctl | col -b | head -120MANWIDTH=100 MANPAGER=cat man 5 systemd.service | col -b | rg -n 'ExecStart|Type=|Restart='man -k 'journal|systemd|network'<command> --help 2>&1 | head -80```Use section numbers: `man 1 command`, `man 5 config-file`, `man 7 topic`, `man 8 admin-command`.## systemd DiagnosisSystem manager is OS-level. User manager is per-user; see `linux-userland` for editing user units.```bashsystemctl --no-pager --full status UNITsystemctl --no-pager --full list-units --failedsystemctl show UNIT -p LoadState -p ActiveState -p SubState -p Result -p ExecMainStatussystemctl cat UNITsystemd-analyze verify /path/to/unit.service````systemctl status` is for humans. `systemctl show` is for parseable properties.## Network Read-Only Probes```baship addrip routeresolvectl status 2>/dev/null || true```## journalctl DiagnosisAlways bound logs:```bashjournalctl -b --no-pager -n 200journalctl -b -u UNIT --no-pager --full -n 200journalctl -b --since '1 hour ago' -p warning..alert --no-pagerjournalctl --list-boots --no-pager```Unprivileged users may not read system journal. If denied, report the permission boundary; do not try `sudo`.## Root EscalationEscalate only after read-only evidence shows user privileges are insufficient. Never execute elevation.Follow the global command-handoff policy.Prefer a direct launch with no shell syntax:```textsudo systemctl status UNIT --no-pager --full```For multi-step or shell-sensitive actions, write a reviewed POSIX shell script in a user-owned path and provide a launch command:```textsudo sh /tmp/pi-root-action.sh```Write the script to a path without spaces, e.g. `/tmp/pi-root-action.sh` or `$HOME/.cache/pi-root-action.sh`. Include:- what it changes- pre-checks- backup path when editing- rollback command- verification command## Common Mistakes| Mistake | Fix || ------------------------------ | --------------------------------------- || Running unbounded `journalctl` | Add `-b`, `-n`, `--since`, `--no-pager` || Treating web docs as exact | Check installed `man`/`--help` || Using `sudo` from agent | Stop; give human command/script || Editing `/etc` directly | Escalate with backup + rollback || Guessing before inventory | Collect host facts + logs first |new file mode 100644+85 / −0 text lines
---name: archlinuxos: lnxdisable-model-invocation: truedescription: "Use for Arch Linux setup and troubleshooting: pacman, AUR/PKGBUILD/makepkg, upgrades, maintenance, boot, services, packages. Not generic Linux or Raspberry Pi."---# Arch LinuxArch-specific system/config/troubleshooting/pkg help.Confirm Arch via `/etc/os-release`; `pacman` alone is not proof.Keep volatile facts out of memory; fetch current docs.## Route- System/maintenance/upgrade → `references/system.md`- Config changes/mirrors/hooks → `references/config.md`- Troubleshooting failures → `references/troubleshooting.md`- Software/pkg/AUR/build issues → `references/software.md`## Fresh TruthLocal first:```shman pacman pacman.conf makepkg PKGBUILD alpm-hooks paccache pacdiff```Web when local docs missing/stale:```texthttps://man.archlinux.org/man/<page>.<section>.enhttps://wiki.archlinux.org/title/<Topic>https://archlinux.org/news/https://archlinux.org/packages/https://aur.archlinux.org/```Before upgrade advice, check Arch News.For exact package/repo/current syntax, use current man/wiki/package pages, not memory.## Local WikiIf offline/frequent Arch work, check:```shpacman -Qq arch-wiki-docs arch-wiki-lite wikiman 2>/dev/null```If absent, suggest installing one.Do not require it.## Safety- No partial upgrades. Avoid `pacman -Sy <pkg>`; use full upgrade flow.- If `-Sy` happened and `-Su` failed: resolve + complete upgrade before other pkg ops.- AUR = untrusted user content. Inspect `PKGBUILD`, `*.install`, patches before build.- `.pacnew`/`.pacsave` need manual merge; never blind overwrite.- Avoid unless current Arch News/wiki explicitly says so: `--overwrite`, `-Rdd`, `--nodeps`, blind `--noconfirm`.- Do not symlink libraries to fix soname errors; complete/recover upgrade.## Root DelegationDo not run root/admin mutations yourself.Follow [linux](../linux/SKILL.md) for system boundaries and human-run escalation, even when the user authorizes the change.Give exact command for user to run.Detect user's shell first for syntax compatibility:```shprintf 'SHELL=%s\n' "$SHELL"getent passwd "$(id -un)" | cut -d: -f7```Command style:- unknown/fish/nu → one simple command per line; avoid arrays, functions, process substitution, brace expansion.- env vars → use `env VAR=value command` for portability.- complex flow → write tiny script or split steps.- state impact + rollback/log path before mutating `/etc`, pacman DB, boot, services.new file mode 100644+9 / −0 text lines
new file mode 100644+72 / −0 text lines
# Arch ConfigUse for `/etc`, pacman config, repos, mirrors, hooks, service/package config.## Before ChangingClassify:- file path- owning package- live reload/restart needed?- backup/rollback path- root required?Read-only probes:```shpacman -Qo /path/to/filepacman -Qii packagesystemctl cat unit.servicesystemctl status unit.service --no-pager```If root edit needed, delegate via user's shell.Prefer editor-safe command, e.g. `sudoedit /etc/file` when appropriate.## Pacman ConfigCurrent truth:`man pacman.conf`, wiki `Pacman`.Stable rules:- Main config: `/etc/pacman.conf`.- Mirror list commonly included from `/etc/pacman.d/mirrorlist`.- Repository order matters when packages share names.- Directives are case-sensitive/CamelCase.- `NoUpgrade`/`NoExtract` paths are archive paths: no leading `/`.- Hooks are non-interactive; system hooks live under `/usr/share/libalpm/hooks/`, admin hooks commonly under `/etc/pacman.d/hooks/`.- Signature policy/current defaults: verify with `man pacman.conf`, do not weaken casually.## Mirrors/ReposFor stale/404/target-not-found problems, inspect:```shgrep -v '^#' /etc/pacman.confgrep -v '^#' /etc/pacman.d/mirrorlist | head```Use current wiki `Mirrors`/`Reflector` before recommending tooling.After repo config changes, full upgrade before installing new packages.## Service/Software Config- Check package docs + Arch Wiki page for that software.- Check ownership before editing generated/package-owned files.- Prefer drop-ins over modifying unit files directly.- State reload command separately: e.g. daemon reload, service restart, app reload.## Current Sources- Man: `pacman.conf(5)`, `alpm-hooks(5)`, `pacman(8)`- Wiki: `Pacman`, `Mirrors`, target software pagenew file mode 100644+87 / −0 text lines
# Arch SoftwareUse for pacman, packages, AUR, PKGBUILD, makepkg, app install/build issues.## Pacman Query Map```shpacman -Ss term # sync DB searchpacman -Si package # sync pkg infopacman -Qs term # installed searchpacman -Qi package # installed pkg infopacman -Ql package # installed filespacman -Qo /path/file # file ownerpacman -Qm # foreign/local/AURpacman -Qtdq # orphan depspacman -F path # remote file owner; needs files DB```Refresh files DB only when needed:`pacman -Fy`.## Install/Remove- Install from repos: `pacman -S package` if DB current; otherwise full upgrade flow.- Full upgrade: `pacman -Syu`.- Install local pkg: `pacman -U ./pkg.pkg.tar.zst`.- Remove package + unneeded deps: `pacman -Rs package`.- Avoid `-Rsc`, `-Rdd`, `--nodeps`, `--overwrite` unless explicitly justified.- Use `--print`/`--print-format` for dry/processable transaction previews.## AURAUR is unsupported/untrusted user content.Agent must inspect before build/install:```shless PKGBUILDls -lagit diff @~..@ # if updating existing clone```Check for:- unexpected network/code exec in build funcs- dangerous `install` scripts- checksum/PGP handling- bundled patches- dependency sanityBuild rules:- `base-devel` is assumed by AUR packages.- Run `makepkg` as normal user, never root.- `makepkg -s` can install repo deps via pacman; AUR deps need separate handling.- `makepkg --verifysource` checks sources without building.- `makepkg --printsrcinfo` for metadata.- Clean chroot helps distinguish user-env failure from broken PKGBUILD.AUR helpers do not remove review duty.## PKGBUILD FactsCurrent truth:`man PKGBUILD`, `man makepkg`.Durable basics:- PKGBUILD is Bash sourced by `makepkg`; treat as executable code.- Minimal fields include `pkgname`, `pkgver`, `pkgrel`, `arch`.- `package()` installs into `$pkgdir`; `prepare()`, `build()`, `check()` optional.- `backup=()` controls pacnew/pacsave behavior for config files.- `source=()` + checksums/PGP define source verification.- Split packages use multiple `pkgname`s and `package_name()` funcs.## Current Sources- Man: `pacman(8)`, `makepkg(8)`, `PKGBUILD(5)`, `makepkg.conf(5)`- Wiki: `Pacman`, `Arch User Repository`, `Creating packages`, `Makepkg`- Live: `archlinux.org/packages`, `aur.archlinux.org`new file mode 100644+59 / −0 text lines
# Arch SystemUse for system state, maintenance, upgrades, health.## First Read-only Probes```shcat /etc/os-releaseuname -apacman -Q pacman 2>/dev/nullsystemctl --failedjournalctl -b --no-pager -p warning..alertpacman -Qmpacman -Qtdq```Do not infer Arch from `pacman` alone; read `/etc/os-release`.## Upgrade Discipline- Read `https://archlinux.org/news/` before upgrade guidance.- Full upgrades only: `pacman -Syu`.- Never advise `pacman -Sy <pkg>`.- Keep rescue/live media in mind for risky kernel/boot/glibc/systemd updates.- After upgrade: review pacman output, handle `.pacnew`, restart affected services or reboot.- AUR/local packages are user's responsibility; rebuild when deps/ABI change.## Maintenance Checks```shsystemctl --failedjournalctl -b --no-pagerpacman -Qtdq # orphan depspacman -Qm # foreign/local/AUR packagespacman -Qkk # file integrity; can be noisy```Package cache:- Prefer `paccache` from `pacman-contrib` over aggressive `pacman -Scc`.- Preserve rollback ability unless disk pressure is real.Config drift:```shfind /etc -name '*.pacnew' -o -name '*.pacsave'grep -E '\.pac(new|save)' /var/log/pacman.log```Use `pacdiff` if present.## Current Sources- Wiki: `System maintenance`, `Pacman`, `Pacman/Pacnew and Pacsave`- Man: `pacman(8)`, `paccache(8)`, `pacdiff(8)`new file mode 100644+97 / −0 text lines
# Arch TroubleshootingUse for boot, service, package transaction, upgrade, and app failures.Start read-only.Identify last change.## Baseline```shcat /etc/os-releaseuname -asystemctl --failedjournalctl -b --no-pager -p err..alerttail -n 80 /var/log/pacman.log```For app issue:```shcommand -v apppacman -Qo "$(command -v app)"pacman -Qi package```If command substitution conflicts with user shell, split into two commands.## Package Transaction ErrorsLock:- Verify no pacman/makepkg/AUR helper process is running before removing lock.- Current lock path/safe handling: check wiki/man.Conflicting files:```shpacman -Qo /path/to/conflict```If unowned, investigate origin before rename/delete.Avoid `--overwrite` unless current Arch guidance says so.Target not found / retrieval failed:- Verify package exists: `archlinux.org/packages`, `pacman -Ss`, AUR if unofficial.- Check enabled repos + mirror freshness.- Do not fix with `pacman -Sy <pkg>`.Invalid/corrupt package/signature:- Check current wiki `Pacman/Package signing` + Arch News.- Suspect stale keyring, partial downloads, bad mirror only after evidence.Interrupted upgrade / broken pacman / unbootable:- Fetch current wiki `Pacman#Troubleshooting` before procedural advice.- Prefer live ISO + mount + `arch-chroot`/`--sysroot` recovery path.- Reconstruct exact failed transaction from `/var/log/pacman.log` when relevant.## Software FailuresClassify:- packaging issue? upstream bug? config? missing optional dep? partial upgrade? service sandbox? permissions?Probes:```shpacman -Qi packagepacman -Ql package | lesspacman -Qii packagejournalctl -b --user --no-pagerjournalctl -b --no-pager -u unit.service```Missing `.so` after upgrades usually means partial/incomplete upgrade orunrebuilt local/AUR package.Do not symlink libs.## Output Shape```textObserved: ...Likely cause: ...Evidence: ...Safe checks: ...User-run root step, if needed: ...Rollback/logs: ...```new file mode 100644+48 / −0 text lines
import assert from "node:assert/strict";import { readFileSync } from "node:fs";import { join } from "node:path";import { test } from "node:test";const root = new URL("..", import.meta.url);const files = [ "SKILL.md", "references/system.md", "references/config.md", "references/troubleshooting.md", "references/software.md",];const docs = files.map((file) => [file, readFileSync(join(root.pathname, file), "utf8")]);const all = docs.map(([, text]) => text).join("\n");test("Arch skill points at current sources before volatile advice", () => { assert.match(all, /https:\/\/archlinux\.org\/news\//); assert.match(all, /https:\/\/wiki\.archlinux\.org\/title\//); assert.match(all, /https:\/\/man\.archlinux\.org\/man\//); assert.match(all, /man pacman/);});test("partial-upgrade hazard is only documented as a warning", () => { for (const [file, text] of docs) { for (const [index, line] of text.split("\n").entries()) { if (!/pacman -Sy(\s|$|<)/.test(line)) continue; assert.match( line, /Avoid|Never|Do not|No partial|happened/, `${file}:${index + 1} must warn about pacman -Sy`, ); } }});test("AUR and dangerous pacman flags keep safety warnings", () => { assert.match(all, /AUR = untrusted|AUR is unsupported\/untrusted/); assert.match(all, /Inspect `PKGBUILD`|inspect before build\/install/); assert.match(all, /Avoid .*--overwrite/); assert.match(all, /Do not symlink libs|Do not symlink libraries/);});test("root mutation guidance delegates instead of auto-running", () => { assert.match(all, /Do not run root\/admin mutations yourself\./); assert.match(all, /\.\.\/linux\/SKILL\.md/); assert.match(all, /sudoedit \/etc\/file/);});new file mode 100644+102 / −0 text lines
---name: linux-consoleos: lnxdisable-model-invocation: truedescription: "Use for Linux kernel virtual consoles (/dev/ttyN, Ctrl+Alt+F1): getty, TERM=linux, vconsole.conf, setfont, loadkeys, setterm, fbcon. Not emulators, ptys, tmux, X11, or Wayland."---# Linux Console## ScopeUse for kernel virtual consoles only:- `/dev/ttyN`- `TERM=linux`- `tty1`, `tty2`, ...- `Ctrl+Alt+F1` / VT switching- `getty`, `vconsole.conf`, `setfont`, `loadkeys`, `setterm`, `fbcon`Do not use for:- graphical terminal emulators- `/dev/pts/*` pseudo-terminals- tmux internals- X11 / Wayland / XKB config## First ProbeIdentify the target host and VT from the user's report before probing.The agent's stdin and `TERM` describe its execution context, not necessarily the target console.Run these in the target session, or ask the user for their output there:```shttyprintf '%s\n' "$TERM"```Interpret:- Target `/dev/ttyN` + `TERM=linux` → real VT likely.- Agent `/dev/pts/N` or `not a tty` → target remains unknown; do not reject VT diagnosis.- Target `/dev/pts/N` → pty; clarify whether a separate VT is the actual target.- User reports `tty1`/`tty2` on another session/host → continue target-specific read-only diagnosis.Use `infocmp -1 linux` to inspect console capabilities; it does not detect the target.Do not send console escape sequences to the agent's terminal as a substitute for the target.Missing local man page → fetch current upstream man page.## Learn Locally FirstPrefer local truth over memory:```shman console_codes | col -bman setterm | col -bman vconsole.conf | col -bman loadkeys | col -bman keymaps | col -bman setfont | col -bman reset | col -binfocmp -1 linux```For deeper lookup:`references/research.md`.## Durable Rules- `TERM=linux` describes Linux-console capabilities via terminfo.- `clear` and `reset` differ; inspect `infocmp -1 linux`.- Linux console interprets control/escape sequences; verify in `console_codes(4)`.- Existing screen cells may need redraw after display/attribute changes.- Keymap, font, palette, and persistence scopes differ; classify first.## Change HygieneFor every proposed change, state:- target: current VT | all VTs | boot/persistent- mechanism: escape seq | terminfo | kbd tool | system config | ioctl- privilege needs: none | user permissions | root/admin | unknown until probed- rollback/reset path## Safety- Never apply X11/Wayland/XKB/niri fixes to Linux console.- Never confuse `/dev/ttyN` with `/dev/pts/N`.- Do not change keymaps/fonts/persistent config without explicit user intent.- Prefer `setterm`, `loadkeys`, `setfont`, `vconsole.conf` docs over guesses.## ReferencesRead when needed:- `references/research.md` — fresh docs, command probes, web fallbacks.- `references/model.md` — VT model, terminfo, reset/clear, screen memory.- `references/tools.md` — setterm/loadkeys/setfont/vconsole scope notes.new file mode 100644+77 / −0 text lines
# Model## Terms- Linux console: kernel console implementation.- Virtual console / VT: numbered console, usually `/dev/ttyN`.- pty: pseudo-terminal, usually `/dev/pts/N`; not a real VT.- `TERM=linux`: terminfo name commonly used by Linux VTs.- framebuffer console / `fbcon`: kernel console display path on many systems.## DetectionEvaluate the target session, not the agent's execution context.Strong signal from the target:```text/dev/ttyN + TERM=linux````/dev/pts/N` identifies the probed session as a pty, not the user's separate VT.Agent output of `/dev/pts/N` or `not a tty` leaves the target unknown.Confirm the target host and VT; continue remote diagnosis rather than stopping.Use exact user wording too:`tty1`, `tty2`, `virtual console`, `linux console`, `Ctrl+Alt+F1`, `getty`,`fbcon`.## Terminfo`infocmp -1 linux` shows what `clear`, `reset`, curses apps, and terminfo-awareprograms will emit.Inspect, do not assume:```shinfocmp -1 linux | grep -E 'clear|rs1|rs2|rs3|oc|op|initc|sgr0'```## Clear vs Reset`clear` normally clears/redraws screen state.`reset` reinitializes terminal state via terminfo reset strings.It may undo palette/display state.Confirm through `infocmp -1 linux` and `man reset`.## Escape Controls`console_codes(4)` is source of truth for Linux-console control sequences.Stable topics there:- control chars- ESC / CSI / OSC sequences- SGR attributes- palette controls- private Linux console sequencesAvoid hard-wiring controls unless the task explicitly needs raw escapes.Prefer terminfo-aware tools when possible.## Screen Memory`vcs(4)` documents `/dev/vcsN` and `/dev/vcsaN` screen-memory devices.They can help inspect or dump VTs.Access depends on device permissions.Prefer `setterm --dump` for simple snapshots when available.## Low-level ioctls`ioctl_console(2)` describes Linux-specific console/VT ioctls and warns they areinternal-ish.Prefer user tools unless low-level work is requested.new file mode 100644+58 / −0 text lines
# Research PatternIdentify the target host and VT first.Run session probes in that target session, or ask the user to run them there:```shttyprintf '%s\n' "$TERM"```The agent's pty or missing tty does not rule out a separate target VT.Inspect capabilities with `infocmp -1 linux`; terminfo lookup is not target detection.Run device probes below only on the target host.Man pages:```shman console_codes | col -bman setterm | col -bman vconsole.conf | col -bman loadkeys | col -bman keymaps | col -bman dumpkeys | col -bman showkey | col -bman setfont | col -bman reset | col -bman terminfo | col -bman vcs | col -bman ioctl_console | col -b```Useful probes:```shinfocmp -1 linux | grep -E '^(\s*(clear|rs[123]|is[123]|oc|op|initc|sgr0)=)'dumpkeys | headkbd_modefgconsole 2>/dev/nullls -l /dev/tty[0-9]* /dev/vcs* /dev/vcsa* 2>/dev/null```If local docs are missing/stale, fetch current upstream docs:- <https://man7.org/linux/man-pages/man4/console_codes.4.html>- <https://man7.org/linux/man-pages/man1/setterm.1.html>- <https://man7.org/linux/man-pages/man5/vconsole.conf.5.html>- <https://man7.org/linux/man-pages/man1/loadkeys.1.html>- <https://man7.org/linux/man-pages/man5/keymaps.5.html>- <https://man7.org/linux/man-pages/man8/setfont.8.html>- <https://man7.org/linux/man-pages/man1/clear.1.html>- <https://man7.org/linux/man-pages/man1/reset.1.html>- <https://man7.org/linux/man-pages/man5/terminfo.5.html>- <https://man7.org/linux/man-pages/man4/vcs.4.html>- <https://man7.org/linux/man-pages/man2/ioctl_console.2.html>Distro docs can explain policy/integration.Prefer upstream man pages for interfaces, distro wiki for packaging/persistencequirks.new file mode 100644+94 / −0 text lines
# Tools## settermUse for terminal attributes and VT-specific controls.Research:```shman setterm | col -bsetterm --help```Common scopes:- foreground/background/rendering attrs: current terminal stream- `--store`: stored defaults for reset-to-default on virtual consoles- blanking, bell, repeat, kernel messages: virtual-console-specific controlsState exact scope before changing.## loadkeys / dumpkeys / showkey / keymapsUse for kernel console keyboard maps, not XKB/X11/Wayland.Research:```shman loadkeys | col -bman keymaps | col -bman dumpkeys | col -bman showkey | col -bdumpkeys | head```Critical scope:`loadkeys` changes the kernel keymap used by virtual consoles; check local docsfor exact reach and permissions.Rollback idea:```shloadkeys --default```Verify with local docs before presenting as final rollback.## setfontUse for Linux console fonts and Unicode maps.Research:```shman setfont | col -bls /usr/share/kbd/consolefonts 2>/dev/null | head```Important:- PSF fonts are common.- Font/glyph choices can affect color availability.- `-O` can save previous font/map.- `-C` can target a console device; permissions vary.## vconsole.conf / localectl / systemd-vconsole-setupUse for boot/persistent virtual-console keyboard/font config on systemd systems.Research:```shman vconsole.conf | col -bman localectl | col -bman systemd-vconsole-setup.service | col -b```State persistence and privilege needs before editing.## Palette / colorsResearch:```shman console_codes | col -bman setterm | col -binfocmp -1 linux | grep -E 'initc|oc|op|setaf|setab'```Linux console color behavior is not the same as graphical terminal emulators.Verify palette, SGR, and reset behavior locally.new file mode 100644+128 / −0 text lines
---name: linux-userlandos: lnxdisable-model-invocation: truedescription: "Use for Linux user-owned config and environment: HOME/XDG paths, shell, PATH, dotfiles, user systemd, desktop/session settings, caches, state dirs."---# Linux UserlandLinux config work inside the user's ownership boundary.**Boundary:** operate under `$HOME` and user managers only. If a fix needs `/etc`, `/usr`, `/var/lib`, packages, kernel settings, devices, or `sudo`, stop and use `linux` escalation.## Workflow1. Identify app/tool, config file discovery rules, and current user/session.2. Resolve XDG paths; do not hard-code `~/.config` if env overrides exist.3. Read installed docs: `man`, `--help`, app config docs in repo/package.4. Inspect current config/env/state.5. Back up before edits; make minimal change.6. Validate with app-specific parser/check command.7. Reload/restart only user-owned process/service. Provide rollback.## XDG Paths| Purpose | Env | Default || ------------------ | ----------------- | -------------------- || Config | `XDG_CONFIG_HOME` | `$HOME/.config` || Data | `XDG_DATA_HOME` | `$HOME/.local/share` || State/logs/history | `XDG_STATE_HOME` | `$HOME/.local/state` || Cache | `XDG_CACHE_HOME` | `$HOME/.cache` || Runtime sockets | `XDG_RUNTIME_DIR` | set by login/session |Probe safely:```bashprintf 'HOME=%s\nXDG_CONFIG_HOME=%s\nXDG_DATA_HOME=%s\nXDG_STATE_HOME=%s\nXDG_CACHE_HOME=%s\nXDG_RUNTIME_DIR=%s\n' \ "$HOME" "${XDG_CONFIG_HOME:-$HOME/.config}" "${XDG_DATA_HOME:-$HOME/.local/share}" \ "${XDG_STATE_HOME:-$HOME/.local/state}" "${XDG_CACHE_HOME:-$HOME/.cache}" "${XDG_RUNTIME_DIR:-}"```XDG env vars must be absolute paths to be valid.## Shell + Environment DiagnosisThe agent's tool shell may not equal the user's interactive shell. Detect before giving syntax:```bashprintf 'SHELL=%s\n' "$SHELL"getent passwd "$(id -un)" | awk -F: '{print "login_shell=" $7}'printf 'PATH=%s\n' "$PATH" | tr ':' '\n'```Startup files by shell:| Shell | Common user files | PATH/export syntax || ------- | -------------------------------------------- | ----------------------------------------- || bash | `~/.bashrc`, `~/.bash_profile`, `~/.profile` | `export NAME=value` || zsh | `~/.zshrc`, `~/.zprofile`, `~/.zshenv` | `export NAME=value` || fish | `~/.config/fish/config.fish` | `set -gx NAME value`; `fish_add_path DIR` || nushell | `~/.config/nushell/env.nu`, `config.nu` | `$env.NAME = value` |Prefer editing the shell's config file over emitting complex copy-paste snippets. If root is needed, do not craft fish/nushell sudo heredocs; use `linux` script escalation.## User systemd UnitsUser units live primarily in `$XDG_CONFIG_HOME/systemd/user` (default `~/.config/systemd/user`).Read:```bashsystemctl --user --no-pager --full list-units --failedsystemctl --user --no-pager --full status UNITsystemctl --user show UNIT -p LoadState -p ActiveState -p SubState -p Result -p ExecMainStatussystemctl --user cat UNITjournalctl --user-unit UNIT -b --no-pager --full -n 200systemd-analyze --user verify "${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user/UNIT"```After editing a user unit:```bashsystemctl --user daemon-reloadsystemctl --user status UNIT --no-pager --fulljournalctl --user-unit UNIT -b --no-pager --full -n 100```Restart only if the user asked for restart or the service was active before edit:```bashsystemctl --user restart UNIT```Use `enable --now` only when the user asked for autostart.## Safe Edit PatternFor an existing regular config file, resolve symlinks first and confirm the target is inside the authorized user-owned boundary.Edit and restore the resolved target, leaving the original symlink intact.A `cp -a` backup of a symlink copies only the link, not a content snapshot.```bashfile=$(realpath -e -- /path/to/file) || exit 1[ -f "$file" ] || exit 1backup=$(mktemp -- "$file.bak.XXXXXX") || exit 1cp -p -- "$file" "$backup" || exit 1# edit "$file"# run validator/reload# rollback if bad: cp -p -- "$backup" "$file"```Stop on resolution or backup failure; do not create a missing symlink target implicitly.Validation examples:- systemd user unit: `systemd-analyze --user verify FILE`- shell config: run the shell parser if available (`bash -n FILE`, `zsh -n FILE`); fish/nushell need shell-specific checks.- app config: use the app's documented `check`, `validate`, `doctor`, or dry-run command.## Common Mistakes| Mistake | Fix || --------------------------------- | -------------------------------------------------------- || Editing `/etc` from userland task | Stop; use `linux` escalation || Assuming bash syntax | Detect shell; prefer editing files or POSIX `sh` scripts || Ignoring XDG overrides | Resolve env/defaults first || Restarting system service | Only use `systemctl --user`; escalate otherwise || Changing config without rollback | Backup + validate + rollback command |new file mode 100644+8 / −0 text lines
new file mode 100644+57 / −0 text lines
import assert from "node:assert/strict";import { spawnSync } from "node:child_process";import { lstatSync, mkdtempSync, readFileSync, readdirSync, rmSync, symlinkSync, writeFileSync } from "node:fs";import { tmpdir } from "node:os";import { join } from "node:path";import { test } from "node:test";const doc = readFileSync(new URL("../SKILL.md", import.meta.url), "utf8");const snippet = doc.match(/## Safe Edit Pattern[\s\S]*?```bash\n([\s\S]*?)```/)[1];for (const symlink of [false, true]) { test(`backup and rollback preserve ${symlink ? "symlinked" : "regular"} config`, { skip: process.platform !== "linux" }, () => { const dir = mkdtempSync(join(tmpdir(), "linux-userland-backup-")); try { const target = join(dir, "config target"); const file = symlink ? join(dir, "config link") : target; writeFileSync(target, "original\n"); if (symlink) symlinkSync(target, file); const script = snippet .replace("/path/to/file", '"$CONFIG_FILE"') .replace('# edit "$file"', 'printf "changed\\n" > "$file"') .replace("# run validator/reload", 'test "$(cat "$backup")" = original || exit 1') .replace("# rollback if bad: ", ""); const result = spawnSync("sh", ["-eu", "-c", script], { env: { ...process.env, CONFIG_FILE: file }, encoding: "utf8", }); assert.equal(result.status, 0, result.stderr); assert.equal(readFileSync(target, "utf8"), "original\n"); assert.equal(lstatSync(file).isSymbolicLink(), symlink); const backups = readdirSync(dir).filter((name) => name.includes(".bak.")); assert.equal(backups.length, 1); assert.ok(lstatSync(join(dir, backups[0])).isFile()); } finally { rmSync(dir, { recursive: true, force: true }); } });}for (const kind of ["missing", "dangling symlink", "directory"]) { test(`refuse ${kind} without creating a backup`, { skip: process.platform !== "linux" }, () => { const dir = mkdtempSync(join(tmpdir(), "linux-userland-backup-")); try { const file = kind === "directory" ? dir : join(dir, "config"); if (kind === "dangling symlink") symlinkSync(join(dir, "missing"), file); const before = readdirSync(dir); const result = spawnSync("sh", ["-eu", "-c", snippet.replace("/path/to/file", '"$CONFIG_FILE"')], { env: { ...process.env, CONFIG_FILE: file }, encoding: "utf8", }); assert.equal(result.status, 1, result.stderr); assert.deepEqual(readdirSync(dir), before); } finally { rmSync(dir, { recursive: true, force: true }); } });}new file mode 100644+123 / −0 text lines
---name: linuxos: lnxdisable-model-invocation: truedescription: "Use for Linux system diagnosis: host state, systemd/journal, services, boot, permissions, devices, network, root escalation. For user-owned config use linux-userland."---# LinuxSafe Linux diagnosis for agents without root.**Boundary:** read system state; do not mutate system config. For user-owned config under `$HOME`, also use `linux-userland`.## Non-Negotiables- No `sudo`, `su`, `doas`, `pkexec`, package manager install/remove, system-service mutation, `/etc` edits, kernel/sysctl changes, or device writes from the agent.- User-service changes follow [linux-userland](../linux-userland/SKILL.md); the system-service ban does not cover them.- Read-only probes first. Prefer commands with `--no-pager`, `--full`, bounded output, and explicit units/time ranges.- Prefer installed truth: `man`, `--help`, distro files. Web docs may not match host version.- Redact secrets from env, tokens, key files, URLs, logs, and command output.- If root is required, explain why and give a copy-paste command or script for the human to run.## Workflow1. Classify: user config? → `linux-userland`. system state/root/service/device/package? → continue here.2. Inventory host facts before hypotheses.3. Inspect installed docs for exact command/config behavior.4. Gather bounded logs/status.5. State root cause confidence + evidence. If changing system state is needed, escalate to human.## Read-Only Inventory```bashuname -acat /etc/os-releaseidprintf 'SHELL=%s\n' "$SHELL"getent passwd "$(id -un)"systemctl --version 2>/dev/null || trueloginctl show-user "$(id -un)" 2>/dev/null || true```## Installed Documentation```bashMANWIDTH=100 MANPAGER=cat man systemctl | col -b | head -120MANWIDTH=100 MANPAGER=cat man 5 systemd.service | col -b | rg -n 'ExecStart|Type=|Restart='man -k 'journal|systemd|network'<command> --help 2>&1 | head -80```Use section numbers: `man 1 command`, `man 5 config-file`, `man 7 topic`, `man 8 admin-command`.## systemd DiagnosisSystem manager is OS-level. User manager is per-user; see `linux-userland` for editing user units.```bashsystemctl --no-pager --full status UNITsystemctl --no-pager --full list-units --failedsystemctl show UNIT -p LoadState -p ActiveState -p SubState -p Result -p ExecMainStatussystemctl cat UNITsystemd-analyze verify /path/to/unit.service````systemctl status` is for humans. `systemctl show` is for parseable properties.## Network Read-Only Probes```baship addrip routeresolvectl status 2>/dev/null || true```## journalctl DiagnosisAlways bound logs:```bashjournalctl -b --no-pager -n 200journalctl -b -u UNIT --no-pager --full -n 200journalctl -b --since '1 hour ago' -p warning..alert --no-pagerjournalctl --list-boots --no-pager```Unprivileged users may not read system journal. If denied, report the permission boundary; do not try `sudo`.## Root EscalationEscalate only after read-only evidence shows user privileges are insufficient. Never execute elevation.Follow the global command-handoff policy.Prefer a direct launch with no shell syntax:```textsudo systemctl status UNIT --no-pager --full```For multi-step or shell-sensitive actions, write a reviewed POSIX shell script in a user-owned path and provide a launch command:```textsudo sh /tmp/pi-root-action.sh```Write the script to a path without spaces, e.g. `/tmp/pi-root-action.sh` or `$HOME/.cache/pi-root-action.sh`. Include:- what it changes- pre-checks- backup path when editing- rollback command- verification command## Common Mistakes| Mistake | Fix || ------------------------------ | --------------------------------------- || Running unbounded `journalctl` | Add `-b`, `-n`, `--since`, `--no-pager` || Treating web docs as exact | Check installed `man`/`--help` || Using `sudo` from agent | Stop; give human command/script || Editing `/etc` directly | Escalate with backup + rollback || Guessing before inventory | Collect host facts + logs first |new file mode 100644+18 / −0 text lines
---name: lnx-workflowos: lnxdescription: "Use for Linux system diagnosis, Arch/pacman/AUR maintenance, kernel virtual consoles, or user-owned HOME/XDG, shell, and user-systemd config."---# Linux workflowRead the matching guide before acting, resolving links relative to this skill directory rather than the project cwd.- Diagnose system services, boot, permissions, devices, networking, or root boundaries: [linux](../linux/SKILL.md).- Configure or troubleshoot Arch Linux packages, pacman, AUR/PKGBUILD, or upgrades: [archlinux](../archlinux/SKILL.md).- Work on kernel virtual consoles, `/dev/ttyN`, getty, fonts, or keymaps: [linux-console](../linux-console/SKILL.md).- Edit user-owned HOME/XDG config, dotfiles, shell environment, or user services: [linux-userland](../linux-userland/SKILL.md).Read each applicable guide when a task crosses these boundaries.A terminal emulator or pty is not a kernel virtual console; generic Linux tasks do not automatically require system diagnosis.Follow each guide's safety constraints; routing never authorizes privileged commands or system mutation.+1 / −1 text lines
Isolate `MISE_DATA_DIR`/`MISE_CACHE_DIR` for temporary probes; local paths do not prevent other side effects.5. For activation warnings, identify all loaded activation files and their generators before editing. Fix the owning generator or confirmed duplicate, not the generated symptom; use `nushell` for `.nu` syntax and `linux-userland` for Linux HOME/XDG boundaries. Fix the owning generator or confirmed duplicate, not the generated symptom; use `nushell` for `.nu` syntax and [linux-userland](../lnx/linux-userland/SKILL.md) for Linux HOME/XDG boundaries.6. Treat config writes, installs/removals, activation-file writes, bootstrap, and cleanup as mutations even with local scope.+1 / −1 text lines
description: "Edit niri Wayland compositor config in KDL — input, keyboard, touchpad, outputs, key bindings, window rules, layout, animations, gestures, VRR, Xwayland, and niri msg IPC commands. Use when: editing ~/.config/niri/config.kdl, configuring niri, mentioned niri-WM, or niri window manager."description: "Use for niri Wayland compositor configuration and IPC."deleted file mode 100644+0 / −62 text lines
# quickshell skillGuidance and small examples for building Linux desktop components with Quickshell.Read [`SKILL.md`](SKILL.md) first.## Contents```textquickshell/├── SKILL.md├── references/├── examples/├── bin/└── package.json```The references intentionally avoid broad service API summaries.Resolve the installed `qs` version and consult its official type pages before writing service, IPC, windowing, or authentication code.## ExamplesThe examples cover:1. a single panel2. one panel per screen3. a clock panel4. PipeWire volume display and control5. a volume OSD6. typed IPC functions7. a composite bar8. a minimal notification daemonExamples are teaching inputs, not proof of target-desktop behavior.Do not launch them on the user's real desktop as routine validation.Notification and authentication components can claim session-global protocols or services.## Validation levels- `npm test` checks the Node helper tools.- `qmllint` checks supported QML structure and installed imports without launching the shell.- An offscreen load check establishes load behavior only.- Interaction acceptance requires exercising input, IPC, timers, hotplug, and service events.- Visual acceptance requires observing mapped surfaces on the target display setup.Runtime checks belong in a nested compositor with isolated runtime and session services.A nested compositor without an isolated D-Bus and service environment is insufficient for notification, tray, Polkit, greetd, or similar checks.Never claim interaction or visual validation from static or offscreen checks.### Upstream tooling boundary[Quickshell recommends `qmlls` with generated `.qmlls.ini`](https://quickshell.org/docs/v0.3.1/guide/install-setup/#language-server) and explicitly documents unresolved `PanelWindow` types.Its runtime backend registration is not fully described by static `.qmltypes`; [issue #543](https://github.com/quickshell-mirror/quickshell/issues/543) tracks related false positives.Use Qt6 tooling, not an unverified executable named `qmllint` that may belong to Qt5.The earlier claim that typed `IpcHandler` functions cause an independent linter defect was incorrect: minimal typed IPC passes with Qt6 and the existing project lint policy.Keep that policy unchanged; do not add warning suppressions or fabricated metadata.The offscreen Qt platform has no Quickshell `PanelWindow` backend.Mapped surfaces, services, and interaction require an isolated nested compositor rather than more offscreen retries.## HelpersSee [`bin/README.md`](bin/README.md).The helpers use Node built-ins and have no package dependencies.deleted file mode 100644+0 / −143 text lines
---name: quickshellos: lnxlicense: LGPL-3.0description: "Use for building, reviewing, or debugging Quickshell desktop components and qs IPC. Not general QML or compositor config."---# Quickshell## Start with the installed version**Do not write Quickshell APIs from memory.**Quickshell changes between releases, especially service modules.1. Run `qs --version`.2. Read the matching official guide and type pages under `https://quickshell.org/docs/v<version>/`.3. When local and web versions may differ, inspect the installed `*.qmltypes` files under `/usr/lib/qt6/qml/Quickshell/` or the platform's equivalent QML import path.4. Cross-check a nearby official example before using a service or compositor-specific API.Use [`references/getting-fresh-docs.md`](references/getting-fresh-docs.md) for the lookup procedure.If cloning upstream examples is necessary, use the `git_clone_safe` tool with the repository URL and an isolated destination.It is a tool, not a shell command.## ModelA Quickshell entry file has one QML root object.There is no rule that it must be `ShellRoot` or `Scope`.A single `PanelWindow` and a per-screen `Variants` object are both valid roots.`ShellRoot` is optional and provides inline shell settings.`Scope` groups non-visual reloadable objects.```qmlimport QtQuickimport QuickshellPanelWindow { anchors { top: true; left: true; right: true } implicitHeight: 30 Text { anchors.centerIn: parent; text: "hello" }}```For one instance per screen:```qmlimport QtQuickimport QuickshellVariants { model: Quickshell.screens delegate: Component { PanelWindow { required property var modelData screen: modelData anchors { top: true; left: true; right: true } implicitHeight: 30 } }}```Use:- `PanelWindow` for anchored panels and layer-shell surfaces.- `FloatingWindow` for ordinary desktop windows.- `PopupWindow` for a popup anchored to another Quickshell window.- `ShellRoot` when the entry needs multiple child objects or inline shell settings.- `Scope` when non-visual objects need a common reload scope.`WlrLayershell` is an attached object on `PanelWindow`, not on `FloatingWindow`.See [`references/windowing.md`](references/windowing.md).## QML rules that matter here- Keep state reactive with property bindings.- Implicit size flows from child to parent; actual size flows from parent to child.- Do not use `childrenRect` as a generic container sizing shortcut because it commonly creates binding loops.- For a service-backed `Slider`, bind `value` to service state and write user movement in `onMoved`. Do not replace the binding with imperative synchronization handlers.- Use `Connections` for signals from a changing external object.- Use `PwObjectTracker` when the matching installed PipeWire docs require tracking an object.See [`references/patterns.md`](references/patterns.md) for the small set of retained patterns.## Services and privileged componentsFor notifications, PipeWire, MPRIS, PAM, greetd, Polkit, Bluetooth, networking, and system tray APIs,read the installed-version type page before coding.Do not advertise a notification capability unless the implementation actually provides it.Do not improvise PAM, greetd, or Polkit conversations.Use the official installed-version example and keep prompts separate from user responses.See [`references/services.md`](references/services.md).## Tooling: follow upstream firstRead the installed version's [official tooling recommendations](https://quickshell.org/docs/v0.3.1/guide/install-setup/#language-server) before diagnosing a linter or inventing metadata.Upstream recommends `qmlls` and an empty `.qmlls.ini` beside the entry point.Quickshell generates the machine-specific configuration; gitignore it and do not hand-maintain its paths.Use the matching Qt major version for both `qmlls` and `qmllint`.On Arch, `/usr/lib/qt6/bin/qmllint` is Qt6; the bare `qmllint` command may be Qt5.Upstream explicitly documents that `PanelWindow` cannot be resolved by the language server.Its runtime backend registration is not fully represented in static metadata; see [issue #543](https://github.com/quickshell-mirror/quickshell/issues/543).This is not evidence that valid panel QML or typed IPC functions are broken.Capture complete stdout/stderr from a minimal reproduction with the correct Qt tool before attributing a failure.Do not fabricate type metadata, remove typing, or disable additional warning categories to obtain a pass.Keep project-approved lint policy and verify actual loading in a nested compositor.## ValidationSeparate these evidence levels:1. **Static:** `qmllint` resolves supported imports and QML structure.2. **Load:** Quickshell loads the configuration without diagnostics.3. **Interaction:** input, IPC, timers, hotplug, and service events behave correctly.4. **Visual:** placement, sizing, clipping, color, typography, and animation are accepted on target displays.A static or offscreen load check proves neither interaction nor visual correctness.Do not claim UI validation without observing and exercising the mapped surfaces.**Never test desktop components against the user's real desktop session by default.**A test instance can claim D-Bus names, notification ownership, layer-shell surfaces, session-lock protocols, or authentication agents.Use a nested compositor plus isolated runtime, D-Bus, and service state for runtime checks.Offscreen validation is limited to parsing or loading and must be reported as such.Never run live authentication or lockscreen tests without an explicit isolated test plan.Run helper tests from this skill directory:```shnpm test```## References- [`references/getting-fresh-docs.md`](references/getting-fresh-docs.md)- [`references/patterns.md`](references/patterns.md)- [`references/windowing.md`](references/windowing.md)- [`references/services.md`](references/services.md)- [`references/resources.md`](references/resources.md)- [`references/packaging.md`](references/packaging.md)- [`examples/`](examples/)- `qml` skill for QML language and layout detailsdeleted file mode 100644+0 / −69 text lines
# quickshell CLI helpersThree cross-platform CLI tools written in Node.js ESM (`.mjs` files). No npm dependencies, only Node built-ins. Run with `node <tool>.mjs` or directly (`./<tool>.mjs` after `chmod +x`).## qs-versionPrint the installed `qs` version and the matching docs URL.```sh$ qs-versionQuickshell 0.3.0https://quickshell.org/docs/v0.3.0/```## qs-scaffoldScaffold a new Quickshell config from an example. Copies `shell.qml` (and any supporting `*.qml` files), the `README.md`, and creates an empty `.qmlls.ini` (LSP marker).```shqs-scaffold mybar # uses 02-per-monitor-bar (default)qs-scaffold foo --from 03-clock # specific exampleqs-scaffold bar --from 07-composite-bar # multi-file: copies Bar.qml too```Result:```~/.config/quickshell/mybar/├── shell.qml├── Bar.qml (if the source example has one)├── README.md└── .qmlls.ini (empty; quickshell will populate)```Then run with `qs -c mybar`.Refuses to clobber an existing target.## qs-docPrint or open the docs URL for a type, namespaced or not.```shqs-doc PanelWindow # bare typehttps://quickshell.org/docs/v0.3.0/types/Quickshell/PanelWindowqs-doc Quickshell.Services.Pipewire.Pipewire # namespacedhttps://quickshell.org/docs/v0.3.0/types/Quickshell/Services/Pipewire/Pipewireqs-doc --list # full type indexhttps://quickshell.org/docs/v0.3.0/typesqs-doc PanelWindow --open # open in browser```## Cross-platform- No shell, no POSIX assumptions; pure `node:child_process`, `node:fs`, `node:os`, `node:path`.- `xdg-open` on Linux, `open` on macOS, `cmd /c start` on Windows for `--open`.- `XDG_CONFIG_HOME` honored; falls back to `~/.config` (Linux/macOS) or `%APPDATA%` (Windows).## TestingTests are in `test/` and use the built-in Node test runner.Run all from the skill root:```shnpm test```deleted file mode 100755+0 / −104 text lines
#!/usr/bin/env node// qs-doc.mjs: open or print docs for the installed Quickshell version.// Cross-platform: no shell, no POSIX assumptions. Pure Node builtins.//// Usage:// qs-doc <Type> # print URL for a type// qs-doc --list # print type index URL// qs-doc <Type> --open # open in default browser// qs-doc <Type> --print # print URL (explicit; same as default)//// Type names use the dot-path shown in the docs (e.g. PanelWindow,// Quickshell.Services.Pipewire.Pipewire).import { spawnSync } from "node:child_process";import { platform } from "node:os";function getVersion() { for (const bin of ["qs", "quickshell"]) { const r = spawnSync(bin, ["--version"], { encoding: "utf8" }); if (r.status === 0) { const m = r.stdout.match(/(\d+\.\d+\.\d+)/); if (m) return m[1]; } } return null;}function usage() { process.stderr.write( "usage: qs-doc <Type> [--open|--print]\n" + " qs-doc --list\n" + " Type: doc path like PanelWindow or Quickshell.Services.Pipewire.Pipewire\n" + " --open open the URL in the default browser\n" + " --print print the URL to stdout (default if stdout is a tty)\n", );}function openUrl(url) { const os = platform(); // Try each platform's open command. Each is a separate spawn without a shell. const candidates = os === "darwin" ? [["open", [url]]] : os === "win32" ? [["cmd", ["/c", "start", "", url]]] : [ ["xdg-open", [url]], ["wslview", [url]], ["sensible-browser", [url]], ]; for (const [cmd, args] of candidates) { const r = spawnSync(cmd, args, { stdio: "ignore" }); if (r.status === 0) return true; } return false;}const argv = process.argv.slice(2);if (argv.length === 0) { usage(); process.exit(1);}const wantList = argv[0] === "--list";const wantOpen = argv.includes("--open");const wantPrint = argv.includes("--print") || !wantOpen;const type = wantList ? null : argv.find((a) => !a.startsWith("--"));if (!wantList && !type) { usage(); process.exit(1);}const version = getVersion();if (!version) { process.stderr.write("qs-doc: cannot find `qs` or `quickshell` on PATH\n"); process.exit(1);}const url = wantList ? `https://quickshell.org/docs/v${version}/types` : (() => { // Type path: "PanelWindow" -> "Quickshell/PanelWindow", // "Quickshell.Services.Pipewire.Pipewire" -> "Quickshell/Services/Pipewire/Pipewire" const path = type.includes("/") ? type : type.startsWith("Quickshell") ? type.replace(/\./g, "/") : `Quickshell/${type.replace(/\./g, "/")}`; return `https://quickshell.org/docs/v${version}/types/${path}`; })();if (wantOpen) { if (!openUrl(url)) { process.stderr.write(`qs-doc: could not open browser; URL: ${url}\n`); process.exit(1); } process.stdout.write(`${url}\n`); process.exit(0);}if (wantPrint) { process.stdout.write(`${url}\n`); process.exit(0);}deleted file mode 100755+0 / −125 text lines
#!/usr/bin/env node// qs-scaffold.mjs: scaffold a new Quickshell config from an example.// Cross-platform: no shell, no POSIX assumptions. Pure Node builtins.//// Usage:// qs-scaffold <name> [--from <example-name>]//// Default example: 02-per-monitor-bar (canonical per-monitor shape).import { copyFileSync, existsSync, mkdirSync, readdirSync, statSync, writeFileSync,} from "node:fs";import { dirname, join } from "node:path";import { fileURLToPath } from "node:url";const __dirname = dirname(fileURLToPath(import.meta.url));const SKILL_ROOT = join(__dirname, "..");const EXAMPLES_DIR = join(SKILL_ROOT, "examples");const DEFAULT_EXAMPLE = "02-per-monitor-bar";function usage() { process.stderr.write("usage: qs-scaffold <name> [--from <example-name>]\n"); process.stderr.write( " example-name: e.g. 01-hello-bar, 07-composite-bar (omit the .qml)\n", );}function parseArgs(argv) { const out = { name: null, from: DEFAULT_EXAMPLE }; for (let i = 2; i < argv.length; i++) { const a = argv[i]; if (a === "-h" || a === "--help") { usage(); process.exit(0); } if (a === "--from") { const v = argv[++i]; if (!v) { process.stderr.write("qs-scaffold: --from requires a value\n"); process.exit(1); } out.from = v; continue; } if (a.startsWith("--")) { process.stderr.write(`qs-scaffold: unknown flag ${a}\n`); process.exit(1); } if (!out.name) { out.name = a; continue; } process.stderr.write(`qs-scaffold: unexpected positional arg ${a}\n`); process.exit(1); } return out;}function xdgConfigHome() { if (process.env.XDG_CONFIG_HOME) return process.env.XDG_CONFIG_HOME; if (process.env.HOME) return join(process.env.HOME, ".config"); // Windows fallback. if (process.env.APPDATA) return process.env.APPDATA; process.stderr.write( "qs-scaffold: cannot determine config dir (set XDG_CONFIG_HOME or HOME)\n", ); process.exit(1);}const { name, from } = parseArgs(process.argv);if (!name) { usage(); process.exit(1);}function requirePathSegment(label, value) { if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(value)) { process.stderr.write( `qs-scaffold: ${label} must be a single path segment: ${value}\n`, ); process.exit(1); }}requirePathSegment("name", name);requirePathSegment("example name", from);// Validate example dir.const exampleDir = join(EXAMPLES_DIR, from);if (!existsSync(exampleDir) || !statSync(exampleDir).isDirectory()) { process.stderr.write( `qs-scaffold: example not found: ${from} (looked in ${EXAMPLES_DIR})\n`, ); process.exit(1);}const configRoot = join(xdgConfigHome(), "quickshell");const target = join(configRoot, name);if (existsSync(target)) { process.stderr.write(`qs-scaffold: target already exists: ${target}\n`); process.exit(1);}mkdirSync(target, { recursive: true });// Copy the example dir's QML + README. Skip hidden / non-source files.for (const entry of readdirSync(exampleDir, { withFileTypes: true })) { if (!entry.isFile()) continue; if (entry.name.startsWith(".")) continue; if (!(entry.name.endsWith(".qml") || entry.name.endsWith(".md"))) continue; copyFileSync(join(exampleDir, entry.name), join(target, entry.name));}// Touch .qmlls.ini for LSP.writeFileSync(join(target, ".qmlls.ini"), "");process.stdout.write(`Scaffolded ${target}\n`);process.stdout.write(`Run: qs -c ${name}\n`);deleted file mode 100755+0 / −28 text lines
#!/usr/bin/env node// qs-version.mjs: print the installed qs version and matching docs URL.// Cross-platform: no shell, no POSIX assumptions. Pure Node builtins.import { spawnSync } from "node:child_process";function getVersion() { for (const bin of ["qs", "quickshell"]) { const r = spawnSync(bin, ["--version"], { encoding: "utf8" }); if (r.status === 0) { // Output looks like: "Quickshell 0.3.0 (revision , distributed by Arch Linux)" const m = r.stdout.match(/(\d+\.\d+\.\d+)/); if (m) return m[1]; } } return null;}const version = getVersion();if (!version) { process.stderr.write( "qs-version: cannot find `qs` or `quickshell` on PATH\n", ); process.exit(1);}process.stdout.write(`Quickshell ${version}\n`);process.stdout.write(`https://quickshell.org/docs/v${version}/\n`);deleted file mode 100644+0 / −59 text lines
// qs-doc.test.mjs// Run: node --test bin/test/qs-doc.test.mjsimport assert from "node:assert/strict";import { spawnSync } from "node:child_process";import { dirname, join } from "node:path";import { test } from "node:test";import { fileURLToPath } from "node:url";const __dirname = dirname(fileURLToPath(import.meta.url));const BIN = join(__dirname, "..", "qs-doc.mjs");test("qs-doc with no args prints usage", () => { const result = spawnSync("node", [BIN], { encoding: "utf8" }); assert.notEqual(result.status, 0); assert.match(result.stderr, /usage/i);});test("qs-doc <Type> prints the type's docs URL for the current qs version", () => { const result = spawnSync("node", [BIN, "PanelWindow"], { encoding: "utf8" }); assert.equal(result.status, 0, `stderr: ${result.stderr}`); // Must contain a quickshell.org URL matching the installed version. assert.match( result.stdout, /https?:\/\/quickshell\.org\/docs\/v\d+\.\d+\.\d+\/types\/Quickshell\/PanelWindow/, );});test("qs-doc accepts a namespaced type like Quickshell.Services.Pipewire.Pipewire", () => { const result = spawnSync( "node", [BIN, "Quickshell.Services.Pipewire.Pipewire"], { encoding: "utf8" }, ); assert.equal(result.status, 0, `stderr: ${result.stderr}`); assert.match( result.stdout, /https?:\/\/quickshell\.org\/docs\/v\d+\.\d+\.\d+\/types\/Quickshell\/Services\/Pipewire\/Pipewire/, );});test("qs-doc with --list prints type index URL", () => { const result = spawnSync("node", [BIN, "--list"], { encoding: "utf8" }); assert.equal(result.status, 0, `stderr: ${result.stderr}`); assert.match( result.stdout, /https?:\/\/quickshell\.org\/docs\/v\d+\.\d+\.\d+\/types/, );});test("qs-doc --open <Type> uses xdg-open (Linux) or platform equivalent", () => { // Just verify the --open flag is recognized (exit 0, no usage message). // We don't actually open a browser in the test (no display guarantee). const result = spawnSync("node", [BIN, "PanelWindow", "--print"], { encoding: "utf8", }); assert.equal(result.status, 0, `stderr: ${result.stderr}`); assert.match(result.stdout, /PanelWindow/);});deleted file mode 100644+0 / −182 text lines
// qs-scaffold.test.mjs// Run: node --test bin/test/qs-scaffold.test.mjsimport assert from "node:assert/strict";import { spawnSync } from "node:child_process";import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync,} from "node:fs";import { tmpdir } from "node:os";import { dirname, join } from "node:path";import { test } from "node:test";import { fileURLToPath } from "node:url";const __dirname = dirname(fileURLToPath(import.meta.url));const BIN = join(__dirname, "..", "qs-scaffold.mjs");function makeTmp() { const dir = mkdtempSync(join(tmpdir(), "qs-scaffold-test-")); return dir;}test("qs-scaffold creates a config dir with shell.qml from default example", () => { const tmp = makeTmp(); try { const result = spawnSync("node", [BIN, "mybar"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }); assert.equal(result.status, 0, `stderr: ${result.stderr}`); const target = join(tmp, "quickshell", "mybar"); assert.ok(existsSync(target), `target dir not created: ${target}`); assert.ok(existsSync(join(target, "shell.qml")), "shell.qml missing"); // The default example is 02-per-monitor-bar (canonical per-monitor shape). const content = readFileSync(join(target, "shell.qml"), "utf8"); assert.match(content, /Variants/); assert.match(content, /Quickshell\.screens/); } finally { rmSync(tmp, { recursive: true, force: true }); }});test("qs-scaffold with --from 01 uses 01-hello-bar", () => { const tmp = makeTmp(); try { const result = spawnSync("node", [BIN, "mybar", "--from", "01-hello-bar"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }); assert.equal(result.status, 0, `stderr: ${result.stderr}`); const shell = readFileSync( join(tmp, "quickshell", "mybar", "shell.qml"), "utf8", ); assert.match(shell, /hello quickshell/i); } finally { rmSync(tmp, { recursive: true, force: true }); }});test("qs-scaffold with --from 07-composite-bar copies Bar.qml too", () => { const tmp = makeTmp(); try { const result = spawnSync( "node", [BIN, "mybar", "--from", "07-composite-bar"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }, ); assert.equal(result.status, 0, `stderr: ${result.stderr}`); const target = join(tmp, "quickshell", "mybar"); const files = readdirSync(target); assert.ok(files.includes("shell.qml"), "shell.qml missing"); assert.ok( files.includes("Bar.qml"), "Bar.qml missing (multi-file example not fully copied)", ); } finally { rmSync(tmp, { recursive: true, force: true }); }});test("qs-scaffold touches .qmlls.ini for LSP", () => { const tmp = makeTmp(); try { const result = spawnSync("node", [BIN, "mybar"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }); assert.equal(result.status, 0, `stderr: ${result.stderr}`); assert.ok( existsSync(join(tmp, "quickshell", "mybar", ".qmlls.ini")), ".qmlls.ini missing", ); } finally { rmSync(tmp, { recursive: true, force: true }); }});test("qs-scaffold without args exits non-zero with usage", () => { const result = spawnSync("node", [BIN], { encoding: "utf8" }); assert.notEqual(result.status, 0); assert.match(result.stderr, /usage/i);});test("qs-scaffold with bad --from exits non-zero", () => { const tmp = makeTmp(); try { const result = spawnSync( "node", [BIN, "mybar", "--from", "99-does-not-exist"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }, ); assert.notEqual(result.status, 0); assert.match(result.stderr, /not found|does not exist/i); } finally { rmSync(tmp, { recursive: true, force: true }); }});test("qs-scaffold rejects a config name that escapes the config root", () => { const tmp = makeTmp(); try { const result = spawnSync("node", [BIN, "../escaped"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }); assert.notEqual(result.status, 0); assert.match(result.stderr, /single path segment/i); assert.equal(existsSync(join(tmp, "escaped")), false); } finally { rmSync(tmp, { recursive: true, force: true }); }});test("qs-scaffold rejects an example name containing path traversal", () => { const tmp = makeTmp(); try { const result = spawnSync( "node", [BIN, "mybar", "--from", "../01-hello-bar"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }, ); assert.notEqual(result.status, 0); assert.match(result.stderr, /single path segment/i); assert.equal(existsSync(join(tmp, "quickshell", "mybar")), false); } finally { rmSync(tmp, { recursive: true, force: true }); }});test("qs-scaffold with existing target dir exits non-zero (no clobber)", () => { const tmp = makeTmp(); try { const target = join(tmp, "quickshell", "mybar"); mkdirSync(target, { recursive: true }); writeFileSync(join(target, "preexisting.txt"), "do not clobber"); const result = spawnSync("node", [BIN, "mybar"], { encoding: "utf8", env: { ...process.env, XDG_CONFIG_HOME: tmp }, }); assert.notEqual(result.status, 0); // Preexisting file must still exist with original content. const still = readFileSync(join(target, "preexisting.txt"), "utf8"); assert.equal(still, "do not clobber"); } finally { rmSync(tmp, { recursive: true, force: true }); }});deleted file mode 100644+0 / −49 text lines
// qs-version.test.mjs// Run: node --test bin/test/qs-version.test.mjsimport assert from "node:assert/strict";import { spawnSync } from "node:child_process";import { dirname, join } from "node:path";import { test } from "node:test";import { fileURLToPath } from "node:url";const __dirname = dirname(fileURLToPath(import.meta.url));const BIN = join(__dirname, "..", "qs-version.mjs");test("qs-version prints version + docs URL when qs is in PATH", () => { // We rely on the system `qs` being installed (it's in /usr/bin on this box). const result = spawnSync("node", [BIN], { encoding: "utf8" }); assert.equal(result.status, 0, `stderr: ${result.stderr}`); // Output must contain "Quickshell" (or "quickshell"), a version, and a docs URL. assert.match( result.stdout, /Quickshell\s+\d+\.\d+\.\d+/i, "must print version", ); assert.match( result.stdout, /https?:\/\/quickshell\.org\/docs\/v\d+\.\d+\.\d+\//, "must print docs URL", ); // The docs URL must match the version line. const versionMatch = result.stdout.match(/(\d+\.\d+\.\d+)/); assert.ok(versionMatch, "must find a version"); assert.ok( result.stdout.includes(`/docs/v${versionMatch[1]}/`), `docs URL must include /docs/v${versionMatch[1]}/`, );});test("qs-version exit code 0 on success", () => { const result = spawnSync("node", [BIN], { encoding: "utf8" }); assert.equal(result.status, 0);});test("qs-version output is 2-3 lines", () => { const result = spawnSync("node", [BIN], { encoding: "utf8" }); const lines = result.stdout.trim().split("\n"); assert.ok( lines.length >= 2 && lines.length <= 3, `got ${lines.length} lines: ${result.stdout}`, );});deleted file mode 100644+0 / −13 text lines
# 01: hello barA `PanelWindow` can be the root object of `shell.qml`.This example anchors one 30-pixel panel to the top edge and renders centered text.Static check:```shqmllint -I /usr/lib/qt6/qml examples/01-hello-bar/shell.qml```Do not launch it on the real desktop merely to validate the skill.Mapped placement and appearance require separate visual acceptance in a nested compositor or explicitly approved session.deleted file mode 100644+0 / −22 text lines
// 01-hello-bar/shell.qml// Smallest valid Quickshell shell: one panel on the focused monitor, "hello world".// Run with: qs -p examples/01-hello-bar/shell.qmlimport QtQuickimport QuickshellPanelWindow { anchors { top: true left: true right: true } implicitHeight: 30 color: "#cc1e1e2e" Text { anchors.centerIn: parent text: "hello quickshell" color: "white" }}deleted file mode 100644+0 / −52 text lines
// 02-per-monitor-bar/Bar.qml// The bar component. Imported from shell.qml with `import "."`.import QtQuickimport QtQuick.Layoutsimport QuickshellPanelWindow { id: bar // Anchored to top, full-width. anchors { top: true left: true right: true } implicitHeight: 32 color: "#cc1e1e2e" // The screen is set by the Variants delegate in shell.qml. // Instantiate the clock; precision defaults to Seconds. SystemClock { id: clock precision: SystemClock.Seconds } Row { anchors.fill: parent anchors.leftMargin: 12 anchors.rightMargin: 12 spacing: 16 // Left side: workspace label (just static here; see Hyprland example for live). Text { text: "Bar" color: "white" font.pointSize: 11 anchors.verticalCenter: parent.verticalCenter } Item { width: 1 } // spacer; the Row stretches // Right side: a clock. Uses Qt.formatDateTime for formatting. Text { text: Qt.formatDateTime(clock.date, "yyyy-MM-dd hh:mm:ss") color: "white" font.pointSize: 11 anchors.verticalCenter: parent.verticalCenter } }}deleted file mode 100644+0 / −15 text lines
# 02: per-monitor bar`Variants` is the entry root and creates a `Bar` for each item in `Quickshell.screens`.The delegate exposes each screen as `modelData` and binds it to the panel's `screen` property.`Bar.qml` is a local PascalCase component imported by `import "."` in `shell.qml`.Check the installed guide before changing local imports to `qs.*` module imports.Static check:```shqmllint -I /usr/lib/qt6/qml examples/02-per-monitor-bar/shell.qml```Static checking does not exercise monitor hotplug or confirm one correctly placed surface per display.deleted file mode 100644+0 / −19 text lines
// 02-per-monitor-bar/shell.qml// Per-monitor bar: one bar per connected screen, via Variants + Quickshell.screens.// Run with: qs -p examples/02-per-monitor-bar/shell.qmlimport QtQuickimport Quickshellimport "."// Variants creates one delegate instance per item in `model`.// `modelData` is the per-iteration value; mark it `required` so qmlls catches misses.Variants { model: Quickshell.screens delegate: Component { Bar { required property var modelData screen: modelData } }}deleted file mode 100644+0 / −17 text lines
# 03: clock panelThis example uses `PanelWindow`, not `FloatingWindow`.`PanelWindow` provides screen-edge anchors and margins.`SystemClock.date` gives the text binding a reactive dependency.The panel anchors to the top edge and uses a calculated left margin for horizontal placement.It does not use `WlrLayershell` on a `FloatingWindow`.Static check:```shqmllint -I /usr/lib/qt6/qml examples/03-clock/shell.qml```Static checking does not prove final placement, typography, or appearance above other windows.Those require visual acceptance in an isolated compositor or explicitly approved session.deleted file mode 100644+0 / −55 text lines
// 03-clock/shell.qml// A floating-style clock panel: appears at top-center of the focused monitor.// Uses PanelWindow (not FloatingWindow) so we get anchors + margins + layer-shell by default.// Run with: qs -p examples/03-clock/shell.qmlimport QtQuickimport QuickshellPanelWindow { // Center horizontally via margins; no `anchors.horizontalCenter` on PanelWindow. anchors { top: true } margins { top: 60 left: (screen.width - implicitWidth) / 2 } implicitWidth: 380 implicitHeight: 90 color: "#dd1e1e2e" // Do not reserve screen space because this is an overlay, not a bar. exclusiveZone: 0 // Round corners via an inner Rectangle (PanelWindow itself can't be rounded). Rectangle { anchors.fill: parent radius: 12 color: "transparent" // fill the panel Column { anchors.centerIn: parent spacing: 4 SystemClock { id: clock precision: SystemClock.Seconds } Text { text: Qt.formatTime(clock.date, "HH:mm:ss") color: "white" font.pointSize: 28 font.bold: true anchors.horizontalCenter: parent.horizontalCenter } Text { text: Qt.formatDate(clock.date, "dddd, MMMM d") color: "#ccd0d0d0" font.pointSize: 12 anchors.horizontalCenter: parent.horizontalCenter } } }}deleted file mode 100644+0 / −70 text lines
// 04-pipewire-volume/Bar.qml// A bar showing the default audio sink volume. Drag the slider to change it.import QtQuickimport QtQuick.Controlsimport QtQuick.Layoutsimport Quickshellimport Quickshell.Services.Pipewireimport Quickshell.WidgetsPanelWindow { id: bar anchors { top: true; left: true; right: true } implicitHeight: 36 color: "#cc1e1e2e" readonly property var sinkAudio: Pipewire.defaultAudioSink ? Pipewire.defaultAudioSink.audio : null // Keep the default sink tracked so its audio object remains available. PwObjectTracker { objects: [ Pipewire.defaultAudioSink ] } RowLayout { anchors.fill: parent anchors.leftMargin: 12 anchors.rightMargin: 12 spacing: 12 // Icon. `Quickshell.iconPath` resolves against the system icon theme. IconImage { implicitSize: 18 source: Quickshell.iconPath( bar.sinkAudio && bar.sinkAudio.muted ? "audio-volume-muted-symbolic" : "audio-volume-high-symbolic" ) } // Mute toggle. The `Connections` watches the service for changes. Text { text: "Mute" color: "white" font.pointSize: 11 MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor onClicked: if (bar.sinkAudio) bar.sinkAudio.muted = !bar.sinkAudio.muted } } Item { Layout.fillWidth: true; Layout.preferredWidth: 1 } // spacer // Service changes update the slider through the value binding. // User movement writes back through onMoved without reacting to initialization. Slider { Layout.preferredWidth: 240 from: 0 to: 1.5 value: bar.sinkAudio ? bar.sinkAudio.volume : 0 onMoved: if (bar.sinkAudio) bar.sinkAudio.volume = value } Text { text: `${Math.floor((bar.sinkAudio ? bar.sinkAudio.volume : 0) * 100)}%` color: "white" font.pointSize: 11 Layout.preferredWidth: 40 } }}deleted file mode 100644+0 / −14 text lines
# 04: PipeWire volumeThis example tracks the default audio sink, displays its state, and binds a slider to its volume.The slider writes back only from `onMoved`, so initialization and service-driven updates do not cause writes.The write checks that the audio object exists.Static check:```shqmllint -I /usr/lib/qt6/qml examples/04-pipewire-volume/shell.qml```This does not exercise PipeWire discovery or volume mutation.A runtime service test needs an isolated PipeWire environment and explicit interaction assertions.deleted file mode 100644+0 / −19 text lines
// 04-pipewire-volume/shell.qml// A bar with the default sink's volume, read and written via PwObjectTracker and Slider.// Run with: qs -p examples/04-pipewire-volume/shell.qmlimport QtQuickimport QtQuick.Layoutsimport Quickshellimport Quickshell.Services.Pipewireimport "."Variants { model: Quickshell.screens delegate: Component { Bar { required property var modelData screen: modelData } }}deleted file mode 100644+0 / −21 text lines
# 05: volume OSDThis example follows the structural OSD pattern:- `Scope` groups the non-visual objects under one reload scope.- `Connections` reacts to changes from the current default sink audio object.- `Timer` controls visibility duration.- `LazyLoader` creates the window only while needed.- `PanelWindow` provides anchored layer-shell placement.- an empty `Region` makes the surface click-through.It does not use `FloatingWindow` with `WlrLayershell`.Static check:```shqmllint -I /usr/lib/qt6/qml examples/05-osd-volume/shell.qml```Do not trigger the real session's audio service during routine validation.Appearance, timing, click-through behavior, and service reaction require separate isolated interaction and visual checks.deleted file mode 100644+0 / −109 text lines
// 05-osd-volume/shell.qml// OSD volume: appears for 1s when the default sink's volume changes.// Pattern: Scope (shared state) + Connections (signal) + Timer (debounce) + LazyLoader (memory-aware) + PanelWindow (default layer).// Run with: qs -p examples/05-osd-volume/shell.qml// Try: `wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.5` in another terminal to trigger.import QtQuickimport QtQuick.Layoutsimport Quickshellimport Quickshell.Services.Pipewireimport Quickshell.WidgetsScope { id: root readonly property var sinkAudio: Pipewire.defaultAudioSink ? Pipewire.defaultAudioSink.audio : null // Keep the default sink tracked. The Connections below needs it to be live. PwObjectTracker { objects: [ Pipewire.defaultAudioSink ] } // Show OSD for 1s after every volume change. Connections { target: root.sinkAudio function onVolumeChanged() { root.shouldShowOsd = true hideTimer.restart() } function onMutedChanged() { root.shouldShowOsd = true hideTimer.restart() } } property bool shouldShowOsd: false Timer { id: hideTimer interval: 1000 onTriggered: root.shouldShowOsd = false } // LazyLoader: only exists when shouldShowOsd. Frees memory between events. // PanelWindow, not FloatingWindow, provides layer-shell placement. LazyLoader { active: root.shouldShowOsd PanelWindow { // The compositor picks the current focused monitor when no screen is set. anchors.bottom: true margins.bottom: screen.height / 5 exclusiveZone: 0 implicitWidth: 400 implicitHeight: 60 color: "transparent" // Empty region = click-through. Clicks pass to whatever's behind. mask: Region {} Rectangle { anchors.fill: parent radius: height / 2 color: "#aa000000" RowLayout { anchors { fill: parent leftMargin: 14 rightMargin: 18 } spacing: 12 IconImage { implicitSize: 28 source: Quickshell.iconPath( root.sinkAudio && root.sinkAudio.muted ? "audio-volume-muted-symbolic" : "audio-volume-high-symbolic" ) } Rectangle { Layout.fillWidth: true implicitHeight: 8 radius: 4 color: "#33ffffff" Rectangle { anchors { left: parent.left top: parent.top bottom: parent.bottom } implicitWidth: parent.width * Math.min(1, root.sinkAudio ? root.sinkAudio.volume : 0) radius: 4 color: "white" } } Text { text: `${Math.floor((root.sinkAudio ? root.sinkAudio.volume : 0) * 100)}%` color: "white" font.pointSize: 13 Layout.preferredWidth: 50 } } } } }}deleted file mode 100644+0 / −24 text lines
# 06: IPC controlThis example exposes explicitly typed functions through `IpcHandler`.The handler target is `mybar`.After starting the configuration in an isolated runtime, inspect and call it with the installed CLI:```shqs ipc showqs ipc call mybar showqs ipc call mybar hideqs ipc call mybar toggleqs ipc call mybar setText "hello"````IpcHandler` signals are observed with `qs ipc wait` or `qs ipc listen` when supported by the installed version.They are not consumed through an invented cross-process `IpcHandler.ipcBus` object.The installed `qmllint` may not handle dynamically declared, explicitly typed `IpcHandler` functions.A non-zero result without diagnostics is not proof that the example is invalid or valid.Cross-check the exact function syntax against the installed `IpcHandler` type page,then use an isolated load and IPC test.Static checking does not prove IPC registration or calls.deleted file mode 100644+0 / −40 text lines
// 06-ipc-control/shell.qml// IpcHandler: expose show/hide/toggle/text functions callable from outside the shell.// Run with: qs -p examples/06-ipc-control/shell.qml// Try:// qs -c ... ipc call mybar show// qs -c ... ipc call mybar hide// qs -c ... ipc call mybar toggle// qs -c ... ipc call mybar setText "hello from outside"import QtQuickimport Quickshellimport Quickshell.IoScope { id: root property string label: "idle" IpcHandler { target: "mybar" // IPC namespace for qs ipc call function show(): void { bar.visible = true } function hide(): void { bar.visible = false } function toggle(): void { bar.visible = !bar.visible } function setText(s: string): void { root.label = s } } PanelWindow { id: bar visible: false anchors { top: true; left: true; right: true } implicitHeight: 40 color: "#cc1e1e2e" Text { anchors.centerIn: parent text: root.label color: "white" } }}deleted file mode 100644+0 / −67 text lines
// 07-composite-bar/Bar.qmlimport QtQuickimport QtQuick.Layoutsimport Quickshellimport Quickshell.Services.Pipewireimport Quickshell.Services.UPowerimport Quickshell.Hyprlandimport Quickshell.WidgetsPanelWindow { id: bar anchors { top: true; left: true; right: true } implicitHeight: 36 color: "#cc1e1e2e" readonly property var sinkAudio: Pipewire.defaultAudioSink ? Pipewire.defaultAudioSink.audio : null // Keep Pipewire nodes alive for state binding. PwObjectTracker { objects: [ Pipewire.defaultAudioSink ] } SystemClock { id: clock; precision: SystemClock.Seconds } RowLayout { anchors.fill: parent anchors.leftMargin: 12 anchors.rightMargin: 12 spacing: 16 // Left: Hyprland workspace indicator (live from Hyprland IPC). Text { color: "white" font.pointSize: 11 text: Hyprland.focusedWorkspace ? `${Hyprland.focusedWorkspace.id}` : "?" } Item { Layout.fillWidth: true } // Center: SystemClock live time. Text { color: "white" font.pointSize: 11 text: Qt.formatDateTime(clock.date, "HH:mm:ss") } Item { Layout.fillWidth: true } // Right cluster: battery + volume. Text { color: "white" font.pointSize: 11 text: UPower.displayDevice ? `${Math.floor(UPower.displayDevice.chargePercentage * 100)}%` : "n/a" } IconImage { implicitSize: 16 source: Quickshell.iconPath( bar.sinkAudio && bar.sinkAudio.muted ? "audio-volume-muted-symbolic" : "audio-volume-high-symbolic" ) } Text { color: "white" font.pointSize: 11 text: `${Math.floor((bar.sinkAudio ? bar.sinkAudio.volume : 0) * 100)}%` } }}deleted file mode 100644+0 / −14 text lines
# 07: composite barThis example combines a per-screen panel with `SystemClock`, PipeWire, UPower, and the Hyprland module.It is intentionally compositor-specific because it imports `Quickshell.Hyprland`.Do not claim that the Hyprland workspace binding is a generic Sway, i3, or Niri interface.Static check:```shqmllint -I /usr/lib/qt6/qml examples/07-composite-bar/shell.qml```Static checking only establishes that the installed imports and QML structure resolve.Service values, workspace updates, per-screen placement, and appearance require isolated runtime and visual checks.deleted file mode 100644+0 / −22 text lines
// 07-composite-bar/shell.qml// Composite: per-monitor bar combining Variants, SystemClock, Pipewire, UPower, Hyprland.// Real-world "give me one of every module on my bar" stress test.// Run with: qs -p examples/07-composite-bar/shell.qmlimport QtQuickimport QtQuick.Layoutsimport Quickshellimport Quickshell.Services.Pipewireimport Quickshell.Services.UPowerimport Quickshell.Hyprlandimport Quickshell.Widgetsimport "."Variants { model: Quickshell.screens delegate: Component { Bar { required property var modelData screen: modelData } }}deleted file mode 100644+0 / −21 text lines
# 08: minimal notification daemonThis example tracks notifications and renders plain summary and body text.It explicitly disables action, persistence, inline-reply, markup, hyperlink, and image capability flags because the UI does not implement them.For a positive `expireTimeout`, which the installed-version docs express in seconds, the example converts to milliseconds for QML `Timer.interval` and calls `Notification.expire()`.Zero leaves the notification visible; a negative timeout requests daemon policy, here five seconds.Each window owns its expiry timer, so removing the notification also removes its timer.`Variants` creates the windows; a Qt Quick `Repeater` cannot use non-Item window delegates.This example has no history, manual dismissal, overflow management, or multi-monitor policy and is not a production daemon.Static check:```shqmllint -I /usr/lib/qt6/qml examples/08-notification-daemon/shell.qml```**Do not launch this against the user's real session during routine validation.**`NotificationServer` attempts to own the session notification service.A runtime test requires an isolated session bus and notification clients.Static checking does not prove ownership, expiry, stacking, interaction, or appearance.deleted file mode 100644+0 / −90 text lines
// Minimal plain-text notification example, not a production daemon.// Run only with an isolated session bus and nested compositor.pragma ComponentBehavior: Boundimport QtQuickimport Quickshellimport Quickshell.Services.NotificationsScope { NotificationServer { id: server actionsSupported: false bodyMarkupSupported: false persistenceSupported: false bodyHyperlinksSupported: false bodyImagesSupported: false inlineReplySupported: false onNotification: notification => notification.tracked = true } // Variants can instantiate windows; Repeater delegates must be Items. Variants { model: server.trackedNotifications delegate: Component { PanelWindow { id: popup required property var modelData anchors { bottom: true right: true } margins { bottom: 30 + server.trackedNotifications.values.indexOf(popup.modelData) * 88 right: 16 } exclusiveZone: 0 implicitWidth: 360 implicitHeight: 80 color: "transparent" mask: Region {} // Quickshell uses seconds: zero persists, negative requests daemon policy. Timer { interval: popup.modelData.expireTimeout > 0 ? popup.modelData.expireTimeout * 1000 : 5000 running: popup.modelData.expireTimeout !== 0 repeat: false onTriggered: popup.modelData.expire() } Rectangle { anchors.fill: parent radius: 8 color: "#dd1e1e2e" border.color: "#444" border.width: 1 Column { anchors.fill: parent anchors.margins: 12 spacing: 4 Text { text: popup.modelData.summary textFormat: Text.PlainText color: "white" font.pointSize: 12 font.bold: true elide: Text.ElideRight width: parent.width } Text { text: popup.modelData.body textFormat: Text.PlainText color: "#ccc" font.pointSize: 10 elide: Text.ElideRight width: parent.width visible: text.length > 0 } } } } } }}deleted file mode 100644+0 / −26 text lines
# Quickshell examplesThese examples demonstrate small configuration shapes.Before adapting one, resolve the installed Quickshell version and check its official type pages.| Example | Demonstrates || ------------------------ | ------------------------------------------------------------------------------- || `01-hello-bar` | A `PanelWindow` as the entry root || `02-per-monitor-bar` | A `Variants` root and one panel per screen || `03-clock` | A top-anchored clock panel || `04-pipewire-volume` | Tracked PipeWire state and reactive slider binding || `05-osd-volume` | `Scope`, `Connections`, `Timer`, `LazyLoader`, and `PanelWindow` || `06-ipc-control` | Explicitly typed `IpcHandler` functions || `07-composite-bar` | Several installed services in one panel || `08-notification-daemon` | Plain notification summary/body rendering without unsupported capability claims |## Validation boundaryUse `qmllint` for static structure and imports.Do not launch these examples on the user's real desktop merely to validate the skill.A panel maps a desktop surface, and the notification example attempts to own the session notification service.Runtime checks require a nested compositor and isolated runtime and service state.Interaction and visual acceptance are separate from static or offscreen loading.The authentication and lockscreen APIs are intentionally not represented by runnable examples here because routine validation must not start live authentication or session-lock flows.deleted file mode 100644+0 / −6 text lines
deleted file mode 100644+0 / −62 text lines
# Getting fresh Quickshell documentationQuickshell APIs change between releases.Resolve the installed version before designing or changing a component.## 1. Identify the installed version```shqs --version```Use the exact reported version in official URLs:- Guide: `https://quickshell.org/docs/v<version>/guide/`- Type index: `https://quickshell.org/docs/v<version>/types/`- Changelog: `https://quickshell.org/changelog/`## 2. Inspect each type usedFor every Quickshell type, verify:- import module- creatable versus singleton status- properties and their units- signals and handler parameters- invokable methods- platform or protocol restrictionsDo not infer one service's shape from another service.Do not preserve a guessed fallback API for older versions.Target the installed version unless the user explicitly requests multiple versions.## 3. Resolve local and web disagreementThe installed module describes what the local binary exposes.On a typical Qt 6 Linux installation, inspect:```text/usr/lib/qt6/qml/Quickshell/**/qmldir/usr/lib/qt6/qml/Quickshell/**/*.qmltypes```Use the equivalent QML import directory on other systems.`*.qmltypes` establishes names, properties, signals, methods, and enums,but prose docs remain necessary for semantics such as units and lifecycle.## 4. Cross-check official examplesUse the official examples repository only when the guide and type pages are insufficient.Call the `git_clone_safe` tool with URL `https://github.com/quickshell-mirror/quickshell-examples` and an isolated destination.Do not invoke it as a shell command.Read the example nearest to the requested component.Do not treat community configuration files as API documentation because they may target another Quickshell revision.## 5. Record evidence honestly`qmllint` provides static evidence only.An offscreen Quickshell load provides load evidence only.Neither proves mapped surfaces, input, compositor behavior, or service integration.Runtime service checks require an isolated D-Bus and service environment.Visual and interaction acceptance require a nested compositor or an explicitly approved target session.deleted file mode 100644+0 / −32 text lines
# Installation and packagingPackage availability and build dependencies change.Use the install guide matching the desired Quickshell release:```texthttps://quickshell.org/docs/v<version>/guide/install-setup/```For an existing machine, inspect before changing anything:```shqs --versionqs --help```Prefer the distribution's supported package path unless the user asks for a source build or another packaging model.Do not add blanket package pinning, source-build scaffolding, compatibility branches, or version gates.If multiple versions are an explicit requirement, define the supported versions and test each one.## Editor setupFollow the installed guide for `qmlls` setup.A `.qmlls.ini` file contains machine-specific paths and should not be copied as portable configuration.## Troubleshooting order1. Capture the exact `qs` version and full diagnostic output.2. Verify the QML import paths and installed modules.3. Check the matching official type page for every unresolved symbol.4. Distinguish a static or load failure from a mapped-surface, compositor-protocol, or service failure.5. Reproduce runtime behavior only in an isolated environment when the configuration can claim desktop protocols or services.deleted file mode 100644+0 / −150 text lines
# Retained patternsVerify every Quickshell type against the installed-version docs before using these patterns.These examples show structure, not cross-version compatibility.## Single panel rootA `PanelWindow` can be the entry file's root object.It does not need a `ShellRoot` wrapper.```qmlimport QtQuickimport QuickshellPanelWindow { anchors { top: true; left: true; right: true } implicitHeight: 30 Text { anchors.centerIn: parent; text: "hello" }}```## One panel per screenA `Variants` object can also be the entry root.```qmlimport QtQuickimport QuickshellVariants { model: Quickshell.screens delegate: Component { PanelWindow { required property var modelData screen: modelData } }}````required property var modelData` exposes the model item to the delegate.## Reactive clock```qmlSystemClock { id: clock precision: SystemClock.Seconds}Text { text: Qt.formatTime(clock.date, "HH:mm:ss")}```The binding updates when `clock.date` changes.A direct `new Date()` expression has no changing QML dependency.## Process output```qmlimport Quickshell.IoProcess { command: ["some-program", "--argument"] running: true stdout: StdioCollector { onStreamFinished: output.text = this.text }}```Pass command arguments as a list.Do not invoke a shell unless shell syntax is explicitly required and trusted.For line-oriented output, use `SplitParser` and its `onRead` signal after verifying the installed type page.## Service-backed sliderAssuming the containing object declares`readonly property var sinkAudio: Pipewire.defaultAudioSink ? Pipewire.defaultAudioSink.audio : null`:```qmlSlider { value: sinkAudio ? sinkAudio.volume : 0 onMoved: if (sinkAudio) sinkAudio.volume = value}```The `value` binding keeps external service changes reactive.`onMoved` limits writes to user movement instead of reacting to initialization or service-driven updates.## Changing signal target```qmlConnections { target: sinkAudio function onVolumeChanged() { showVolumeOsd() }}```Bind `target` to the current service object because the object may appear, disappear, or be replaced.## Conditional non-Item object```qmlLazyLoader { active: shouldShow PanelWindow { /* content */ }}```Use `LazyLoader` for a conditionally instantiated window.Use ordinary `visible` when retaining the object is intentional.## Click-through panel```qmlPanelWindow { color: "transparent" mask: Region {}}```An empty `Region` makes the window's input mask empty.Confirm interaction in a nested compositor because static loading cannot prove click-through behavior.## IPC callable```qmlimport Quickshell.IoIpcHandler { target: "mybar" function toggle(): void { panel.visible = !panel.visible }}```IPC function argument and return types must be explicit and supported by the installed version.Inspect registered handlers with `qs ipc show`, then call the function with `qs ipc call mybar toggle`.## Multi-file configurationNeighboring PascalCase QML files can define local types.For subdirectories, follow the installed guide's `qs.*` import rules.Do not add compatibility imports or version gates unless the user explicitly requires multiple Quickshell versions.deleted file mode 100644+0 / −78 text lines
# Resources and I/OVerify these APIs against the installed-version type pages before using them.## Paths- `Qt.resolvedUrl("asset.png")` resolves relative to the current QML file.- `Quickshell.cachePath(...)`, `dataPath(...)`, and `statePath(...)` return shell-specific paths when exposed by the installed version.- `Quickshell.env("NAME")` reads an environment variable.Choose cache, data, and state according to XDG semantics.Do not claim that a path helper itself persists QML properties.## Icons```qmlimport Quickshell.WidgetsIconImage { source: Quickshell.iconPath("audio-volume-high-symbolic") implicitSize: 24}```Check the installed `Quickshell.iconPath` overloads before adding fallback behavior.An icon name still depends on the active icon theme.## FileView and JsonAdapter`JsonAdapter` is an adapter owned by `FileView`.It does not have a `path` property and does not infer arbitrary properties from a JSON file.Declare the adapter properties explicitly.```qmlimport Quickshell.IoFileView { path: Qt.resolvedUrl("config.json") watchChanges: true onFileChanged: reload() JsonAdapter { property string accent: "blue" }}```Read the installed `FileView` and `JsonAdapter` pages before enabling writes.Writing configuration requires an explicit save policy and data-loss handling.## Reload state`PersistentProperties` carries declared properties across a Quickshell configuration reload.It does not provide durable persistence across process restarts.Use its documented `reloadableId` behavior and do not describe it as disk storage.## IPC`IpcHandler` exposes explicitly typed functions, properties, and signals through `qs ipc`.```qmlimport Quickshell.IoIpcHandler { target: "mybar" function setText(value: string): void { label.text = value } signal changed(value: string)}```- Inspect registrations with `qs ipc show`.- Call functions with `qs ipc call mybar setText "value"`.- Observe exported signals with the installed CLI's `qs ipc wait` or `qs ipc listen` commands.- Do not invent an `IpcHandler.ipcBus` singleton or use `Connections` as cross-process IPC.Function argument and return types must be explicit and supported by the installed version.deleted file mode 100644+0 / −90 text lines
# Services**Service APIs are version-sensitive and can mutate the user's session.**Start from the installed-version type index, not from a remembered recipe.Inspect local `*.qmltypes` files when the installed module and web docs may differ.## PipeWireThe retained default-sink shape is:```qmlimport QtQuickimport Quickshellimport Quickshell.Services.PipewirePanelWindow { id: root anchors { top: true; left: true; right: true } implicitHeight: 30 readonly property var sinkAudio: Pipewire.defaultAudioSink ? Pipewire.defaultAudioSink.audio : null PwObjectTracker { objects: [Pipewire.defaultAudioSink] } Text { anchors.centerIn: parent text: `${Math.floor((root.sinkAudio ? root.sinkAudio.volume : 0) * 100)}%` }}```For a slider, keep the service-to-control binding declarative and write only user movement:```qmlSlider { value: root.sinkAudio ? root.sinkAudio.volume : 0 onMoved: if (root.sinkAudio) root.sinkAudio.volume = value}```Verify the tracker and node properties against the installed PipeWire module before extending this shape.## NotificationsCreating `NotificationServer` attempts to become the session notification daemon.Do not run it alongside the user's real notification daemon during tests.Capability properties advertise behavior to clients.Set `actionsSupported`, `persistenceSupported`, `inlineReplySupported`, markup, hyperlinks, images, or action icons to true only when the UI implements that behavior.Receiving a property from `Notification` does not mean the daemon implements its presentation or interaction.A received notification must be marked `tracked` in `onNotification` if it should remain in `trackedNotifications`.`Notification.expireTimeout` is expressed in seconds in the installed-version docs checked for this skill.Use `expire()` for timeout expiry and `dismiss()` for an explicit user dismissal because they report different close reasons.Re-check these semantics for the installed version.The bundled notification example intentionally renders only plain summary and body text.It does not advertise actions, persistence, inline reply, markup, hyperlinks, or images.## PAMNever send the PAM prompt text back as the response.The prompt is display state.The response comes from the user's input and may be sent only while `responseRequired` is true.Honor `responseVisible` when deciding whether user input may be shown.Do not use an abbreviated PAM recipe for a lockscreen.Read the complete installed-version `PamContext` page and official lockscreen example.Do not run live PAM or lockscreen checks during routine skill validation.## greetd and PolkitThese components participate in authentication and session authorization.Do not guess method names, lifecycle order, or response objects.Use the installed-version type pages and official examples.Test only in an isolated environment with a recovery path.## MPRIS, system tray, UPower, Bluetooth, and networkingLook up the installed module name and exported types before importing them.Module names and singleton shapes are not uniform across these services.If the installed API cannot support a requested feature, report the blocker.Do not silently delete requested behavior or add guessed adapters and compatibility branches.## Runtime isolationA nested compositor alone does not isolate D-Bus or per-user services.For service tests, isolate the runtime directory, session bus, and relevant service daemons as well.Static `qmllint` and offscreen loading do not validate service ownership, events, or interaction.deleted file mode 100644+0 / −78 text lines
# WindowingRead the installed-version type page for each window and attached property before coding.## PanelWindowUse `PanelWindow` for a decorationless surface attached to screen edges.It can be the root object of `shell.qml`.```qmlimport QuickshellPanelWindow { anchors { top: true; left: true; right: true } implicitHeight: 30 margins { top: 4; left: 4; right: 4 }}```Opposite anchors force the corresponding dimension to span the screen between margins.The exclusion zone only takes effect with the anchor combinations documented by the installed `PanelWindow` type page.For click-through rendering:```qmlPanelWindow { color: "transparent" mask: Region {}}```## FloatingWindowUse `FloatingWindow` for an ordinary desktop window controlled by the window manager.Do not use panel anchors or `WlrLayershell` on it.```qmlimport QuickshellFloatingWindow { width: 600 height: 400}```## PopupWindowUse `PopupWindow` only when the popup is anchored to another Quickshell window.Its anchor API is version-sensitive, so read the installed `PopupWindow` and `PopupAnchor` pages rather than copying a recipe from this skill.## Layer shell`WlrLayershell` is an attached object on `PanelWindow`.It is not attached to `FloatingWindow`.```qmlimport Quickshellimport Quickshell.WaylandPanelWindow { WlrLayershell.layer: WlrLayer.Overlay WlrLayershell.namespace: "my-osd"}```Layer-shell support depends on the compositor protocol, not on a blanket "Wayland" or "wlroots" label.Niri is not wlroots-based.i3 is an X11 window manager; Sway is its Wayland counterpart.Verify the target compositor's protocol support independently.## Session lock`WlSessionLock` and `WlSessionLockSurface` are security-sensitive protocol objects.Do not derive a lockscreen from an abbreviated recipe.Use the official example matching the installed Quickshell version and review the complete PAM conversation.Never launch a lockscreen or authentication flow on the real session during routine validation.Use a nested compositor and isolated authentication setup with an explicit recovery path.+1 / −1 text lines
description: "WezTerm terminal emulator configuration: Lua config, panes, tabs, domains, key bindings, and appearance. Use for configuring WezTerm itself; use terminal-harness to drive interactive terminal programs."description: "Use for WezTerm config: Lua, panes, tabs, domains, key bindings, appearance. Use terminal-harness to drive interactive programs."