Imported from mahkoh/jay (
book/AGENTS.md). Install upstream withnpx skills add mahkoh/jay --skill book. Copyright stays with the author.
Jay Book -- Agent Instructions
User-facing mdbook documentation for the Jay Wayland compositor. Target audience is end users, not developers. Goal is feature discoverability.
Quick reference
Book files (book/src/)
The table of contents is SUMMARY.md — it is the authoritative chapter
list and must be updated when adding a new chapter. Chapter-to-topic mapping:
| File | Covers |
|---|---|
configuration/index.md |
Config overview: replacement semantics, jay config init, auto-reload |
configuration/shortcuts.md |
Shortcuts, actions (simple + parameterized), marks, named actions, virtual outputs, actions in window rules |
configuration/startup.md |
Startup hooks (on-graphics-initialized, on-idle, on-resume) |
configuration/outputs.md |
Monitor config, VRR, tearing, scaling, transforms |
configuration/inputs.md |
Input devices, per-device settings |
configuration/keymaps.md |
Keymaps, repeat rate |
configuration/idle.md |
Idle timeout, screen locking |
configuration/gpu.md |
GPU selection, multi-GPU |
configuration/theme.md |
Theme, appearance |
configuration/status-bar.md |
Status bar config |
configuration/xwayland.md |
Xwayland |
configuration/environment.md |
Environment variables |
configuration/transactions.md |
Transactions: atomic/glitch-free layout updates, transaction & configure timeouts |
configuration/misc.md |
Color management, libei, floating defaults, ui-drag |
tiling.md |
i3-like tiling layout, splitting containers |
workspaces.md |
Virtual desktops, workspace management, multi-monitor |
floating.md |
Floating windows, window management mode |
mouse.md |
All mouse-driven interactions (resize, drag, scroll) |
input-modes.md |
Modal keybinding system (push/pop/latch/clear) |
window-rules.md |
Window/client rules, privileges, capabilities |
counters-and-triggers.md |
Counters (inc-counter/dec-counter/set-counter) and [[triggers]], max-trigger-depth |
screen-sharing.md |
Screen sharing via xdg-desktop-portal, PipeWire |
hdr.md |
HDR & color management walkthrough |
environment-variables.md |
Environment variables Jay itself reads (system, cursor, X backend, CLI, JAY_* tuning) |
control-center.md |
All control center panes (see pane list below) |
cli.md |
All CLI subcommands, JSON output |
tracing.md |
jay trace: selecting clients, text output, unique object IDs, dropped messages, -o redirection, JSONL record format |
debugfs-internals.md |
For developers: declaring debugfs directories in *_g_fuse.rs files, running the generator, generated traits, keys, timeouts, liveness, StrFmt, collection views |
Source-of-truth files (from repo root)
| File | What it tells you |
|---|---|
toml-spec/spec/spec.yaml |
Canonical TOML config spec: every key, action, match criterion, type |
toml-config/src/default-config.toml |
Built-in default config (keybindings, startup actions) |
toml-config/src/config/parsers/action.rs |
Action parser — see which type strings are accepted |
toml-config/src/lib.rs |
Action dispatch — window_or_seat! macro shows which actions work in window rules |
src/config/handler.rs |
Config handler; update_capabilities shows capability replacement semantics |
src/cli/*.rs |
CLI subcommands (clap definitions) |
src/control_center/cc_*.rs |
Control center panes: 11 sidebar panes + cc_window.rs / cc_clients.rs detail panes + cc_criterion.rs shared helper. Verify field names/ordering here |
toml-config/src/config/parsers/exec.rs |
Exec parser (string, array, or table forms) |
Critical facts
-
Config replacement.
~/.config/jay/config.tomlreplaces the entire built-in default — not merged. Empty file = no shortcuts, nothing. Users must runjay config init. -
Config reload. Manual by default (
alt-shift-r/reload-config-toml).auto-reload = trueenables inotify watching with 400 ms debounce. -
Actions are composable. Anywhere an action is accepted, an array works. Named actions (
$name) add reuse. -
Exec action gotcha. Plain string = program name only (no arg splitting).
exec = "notify-send 'hello'"is wrong — use array form. -
Capability replacement. When any client rule matches, its capabilities replace defaults entirely (not additive). Verify against
handler.rs:update_capabilities. -
Window rule actions. Actions using
window_or_seat!inlib.rswork in both shortcuts (focused window) and window rules (matched window). The list in shortcuts.md "Actions in window rules" must stay in sync. -
Window/client rules are reactive. Re-evaluated when criteria change.
latchfires when a rule stops matching. -
VRR vs tearing subtlety. VRR variant1/2 use "fullscreen"; tearing variant3 says "a single application is displayed" (not necessarily fullscreen). Always check spec.yaml wording.
Style rules
- Audience: users, not developers. Explain what, not how.
- Code fences:
```shellfor commands (prefix~$),```tomlfor config. - Admonitions:
> [!NOTE],> [!TIP],> [!WARNING],> [!IMPORTANT]. - Key combos: backticks, lowercase modifiers:
alt-shift-c,ctrl-alt-F2,alt-Return. NeverAlt+C. - Definition lists for two-column term/description. Tables only for 3+ data columns.
- TOML formatting: multiline with trailing commas, 4-space indent.
- Examples: practical, not abstract. Link to spec.generated.md for exhaustive listings.
- Control center docs: verify field names, ordering, and conditional
visibility against
cc_*.rssource files. Labels must match exactly.
Common tasks
Documenting a new action
-
Read
git difffor the commit introducing the action. Key files:toml-spec/spec/spec.yaml— spec entry (description, fields, examples)toml-config/src/config/parsers/action.rs— parser (field names, types, defaults)toml-config/src/lib.rs— dispatch (check ifwindow_or_seat!is used)jay-config/src/input.rsand/orjay-config/src/window.rs— Rust API
-
Edit
book/src/configuration/shortcuts.md:- Simple actions (no fields): add to the appropriate list in the "Simple actions" section.
- Parameterized actions (has fields): add a new
###subsection before "Other parameterized actions". Include definition list for fields and practical TOML examples. - Also parameterized but minor: just add a
- name -- descriptionbullet to the "Other parameterized actions" list.
-
If
window_or_seat!is used inlib.rs, add the action name to the "Actions in window rules" list at the bottom ofshortcuts.md.
Documenting a new config field
- Read
toml-spec/spec/spec.yamlfor the field definition. - Identify which book chapter covers that config section (see table above).
- Add the field with a definition-list entry or example, matching the existing style of that chapter.
Documenting a new CLI subcommand
- Read
src/cli/*.rsfor clap definitions. - Edit
book/src/cli.md. Follow the existing pattern for subcommand docs. - If the subcommand has
--jsonsupport, mention it in the "JSON Output" section.
Documenting a control center change
- Read the relevant
src/control_center/cc_*.rsfile. - Edit
book/src/control-center.md. Match field names, ordering, and conditional visibility exactly.
Adding a new book chapter
- Create the new
.mdfile underbook/src/. - Add an entry in
book/src/SUMMARY.mdunder the appropriate section. - Update the chapter-to-topic mapping in this file and
AGENTS.md.
Building
~$ cd book && mdbook build # outputs to book/book/
~$ cd book && mdbook serve # preview at http://localhost:3000