Skip to main content

max / alloy

11.5 KB · 303 lines History Blame Raw
1 # A schema for rio.toml. Test fixture, not a shipped catalog entry.
2 #
3 # rio was Alloy's terminal until 2026-07-31, when shop replaced it
4 # (docs/STACK.md#terminal). This file left `schemas/` with rio itself, and is
5 # kept here because it is the only artifact that exercises the whole schema
6 # DSL at once: structured enums, a 29-entry group, and a
7 # list-of-tables. `schemas/shop.toml.schema` is three plain fields and would
8 # leave most of the parser untested.
9 #
10 # Nothing reads it but `schema.rs`'s tests. It describes a tool the image does
11 # not carry, so do not put it back on the search path; if a shipped schema
12 # needs a feature, exercise the feature here and use it there.
13 #
14 # Format: schema-format v1. See docs/CONSOLE.md#the-schema-format for
15 # the DSL reference. `alloy config <path>` renders a form from this
16 # schema, edits values in place via toml_edit, and preserves any keys
17 # not covered here (unknown_keys = "preserve").
18
19 [schema]
20 target = "rio.toml"
21 target_path = "$XDG_CONFIG_HOME/rio/config.toml"
22 target_tool = "rio"
23 target_version = ">=0.2"
24 schema_version = "1"
25 unknown_keys = "preserve"
26
27 # -------------------------------------------------------------------
28 # UI sections — the form renders one collapsible pane per section,
29 # ordered as declared here. Fields fall into a section by path prefix.
30 # -------------------------------------------------------------------
31
32 [[section]]
33 path = "navigation"
34 description = "Rio tab / split behavior. Alloy runs Sway for tiling, so the default disables both."
35
36 [[section]]
37 path = "window"
38 description = "Window frame, opacity, and decorations."
39
40 [[section]]
41 path = "renderer"
42 description = "GPU backend and render performance."
43
44 [[section]]
45 path = "fonts"
46 description = "Font family, weights, and size."
47
48 [[section]]
49 path = "cursor"
50 description = "Cursor shape and blink."
51
52 [[section]]
53 path = "colors"
54 description = "ANSI palette and semantic colors."
55
56 [[section]]
57 path = "bindings"
58 description = "Rio-scoped keybindings. Empty by default; Sway owns global binds."
59
60 # -------------------------------------------------------------------
61 # Fields — navigation
62 # -------------------------------------------------------------------
63
64 [[field]]
65 path = "navigation.mode"
66 type = "enum"
67 default = "Plain"
68 description = "Rio-native tab and split behavior."
69 values = [
70 { value = "Plain", label = "Plain", description = "No tabs, no splits. Recommended under Sway." },
71 { value = "CollapsedTab", label = "Collapsed tabs", description = "Rio-drawn tab strip, collapsed." },
72 { value = "BottomTab", label = "Bottom tabs", description = "Rio-drawn tabs at the bottom." },
73 { value = "TopTab", label = "Top tabs", description = "Rio-drawn tabs at the top." },
74 ]
75
76 # -------------------------------------------------------------------
77 # Fields — window
78 # -------------------------------------------------------------------
79
80 [[field]]
81 path = "window.background-opacity"
82 type = "float"
83 range = [0.0, 1.0]
84 default = 1.0
85 description = "Window background opacity (0 = transparent, 1 = opaque)."
86
87 [[field]]
88 path = "window.decorations"
89 type = "enum"
90 default = "Disabled"
91 description = "Client-side decorations. Alloy runs Sway with server-side frame-off; leave Disabled."
92 values = [
93 { value = "Enabled", label = "Enabled", description = "Rio draws its own title bar." },
94 { value = "Disabled", label = "Disabled", description = "No decorations (recommended under Sway)." },
95 { value = "Transparent", label = "Transparent", description = "Frameless with transparency." },
96 ]
97
98 # -------------------------------------------------------------------
99 # Fields — renderer
100 # -------------------------------------------------------------------
101
102 [[field]]
103 path = "renderer.performance"
104 type = "enum"
105 default = "High"
106 description = "Render-loop performance target. Lower reduces GPU load on battery."
107 values = ["High", "Low"]
108
109 # renderer.backend is deliberately absent.
110 #
111 # It was described here as an enum defaulting to "Automatic". Rio 0.4.11 does
112 # not accept that variant, and rejecting a value is not local to the key: the
113 # file fails to parse and rio falls back to stock defaults entirely. Alloy's
114 # config now omits the key, which is what "Automatic" meant, so there is no
115 # variant list here to drift out of step with the package again.
116
117 [[field]]
118 path = "renderer.disable-unfocused-render"
119 type = "bool"
120 default = false
121 description = "Skip rendering while the window is unfocused. Saves power at the cost of stale content flashes on refocus."
122
123 # -------------------------------------------------------------------
124 # Fields — fonts
125 # -------------------------------------------------------------------
126
127 [[field]]
128 path = "fonts.size"
129 type = "float"
130 range = [6.0, 48.0]
131 default = 12.0
132 description = "Font size in points. 12 at 1080p; 13-14 on HiDPI or larger panels."
133
134 [[field]]
135 path = "fonts.family"
136 type = "string"
137 default = "IosevkaTerm Nerd Font"
138 description = "Default font family. A fixture for the schema parser, and rio is retired: Alloy's terminal is shop and its mono face is Quasi Mono (docs/STACK.md#fonts)."
139
140 # Weight/style variants: repeating tables with the same shape.
141 # Written out per variant because the paths are literal keys, not a list.
142
143 [[field]]
144 path = "fonts.regular.family"
145 type = "string"
146 default = "IosevkaTerm Nerd Font"
147 description = "Regular-variant family."
148
149 [[field]]
150 path = "fonts.regular.style"
151 type = "enum"
152 values = ["Normal", "Italic"]
153 default = "Normal"
154 description = "Regular-variant style."
155
156 [[field]]
157 path = "fonts.regular.weight"
158 type = "int"
159 range = [100, 900]
160 default = 400
161 description = "Regular-variant weight (100-900, 400 = normal)."
162
163 [[field]]
164 path = "fonts.bold.family"
165 type = "string"
166 default = "IosevkaTerm Nerd Font"
167 description = "Bold-variant family."
168
169 [[field]]
170 path = "fonts.bold.style"
171 type = "enum"
172 values = ["Normal", "Italic"]
173 default = "Normal"
174 description = "Bold-variant style."
175
176 [[field]]
177 path = "fonts.bold.weight"
178 type = "int"
179 range = [100, 900]
180 default = 600
181 description = "Bold-variant weight."
182
183 [[field]]
184 path = "fonts.italic.family"
185 type = "string"
186 default = "IosevkaTerm Nerd Font"
187 description = "Italic-variant family."
188
189 [[field]]
190 path = "fonts.italic.style"
191 type = "enum"
192 values = ["Normal", "Italic"]
193 default = "Italic"
194 description = "Italic-variant style."
195
196 [[field]]
197 path = "fonts.italic.weight"
198 type = "int"
199 range = [100, 900]
200 default = 400
201 description = "Italic-variant weight."
202
203 [[field]]
204 path = "fonts.bold-italic.family"
205 type = "string"
206 default = "IosevkaTerm Nerd Font"
207 description = "Bold-italic-variant family."
208
209 [[field]]
210 path = "fonts.bold-italic.style"
211 type = "enum"
212 values = ["Normal", "Italic"]
213 default = "Italic"
214 description = "Bold-italic-variant style."
215
216 [[field]]
217 path = "fonts.bold-italic.weight"
218 type = "int"
219 range = [100, 900]
220 default = 600
221 description = "Bold-italic-variant weight."
222
223 # -------------------------------------------------------------------
224 # Fields — cursor
225 # -------------------------------------------------------------------
226
227 [[field]]
228 path = "cursor.shape"
229 type = "enum"
230 values = ["block", "underline", "beam"]
231 default = "block"
232 description = "Cursor shape."
233
234 [[field]]
235 path = "cursor.blinking"
236 type = "bool"
237 default = false
238 description = "Whether the cursor blinks."
239
240 # -------------------------------------------------------------------
241 # Group — colors
242 #
243 # All 25 palette slots share type = color, format = hex. The group
244 # expands to one field per entry at `colors.<key>`.
245 # -------------------------------------------------------------------
246
247 [[group]]
248 path = "colors"
249 type = "color"
250 format = "hex"
251 description = "Terminal palette. Every slot carries the Akari Dawn default and can be tuned on its own."
252 entries = [
253 { key = "background", default = "#e4ded6", description = "Surface background." },
254 { key = "foreground", default = "#1a1816", description = "Primary text." },
255 { key = "cursor", default = "#1a1816", description = "Cursor color." },
256 { key = "selection-background", default = "#dad2c7", description = "Selected-text background (border-subtle)." },
257 { key = "selection-foreground", default = "#1a1816", description = "Selected-text foreground." },
258
259 # Normal ANSI 0-7
260 { key = "black", default = "#1a1816", description = "ANSI 0 — text-primary." },
261 { key = "red", default = "#6a2828", description = "ANSI 1 — accent-error." },
262 { key = "green", default = "#3a5830", description = "ANSI 2 — accent-ok." },
263 { key = "yellow", default = "#b07840", description = "ANSI 3 — accent-warn." },
264 { key = "blue", default = "#304050", description = "ANSI 4 — accent-info." },
265 { key = "magenta", default = "#806080", description = "ANSI 5 — accent-syntax." },
266 { key = "cyan", default = "#222d38", description = "ANSI 6 — text-secondary (Alloy has no cyan accent)." },
267 { key = "white", default = "#ede7de", description = "ANSI 7 — surface-raised." },
268
269 # Dim / bright ANSI 8-15
270 { key = "dim-black", default = "#222d38", description = "ANSI 8 — text-secondary." },
271 { key = "dim-red", default = "#6a2828", description = "ANSI 9." },
272 { key = "dim-green", default = "#3a5830", description = "ANSI 10." },
273 { key = "dim-yellow", default = "#b07840", description = "ANSI 11." },
274 { key = "dim-blue", default = "#304050", description = "ANSI 12." },
275 { key = "dim-magenta", default = "#806080", description = "ANSI 13." },
276 { key = "dim-cyan", default = "#514b45", description = "ANSI 14 — text-muted." },
277 { key = "dim-foreground", default = "#514b45", description = "Dim foreground fallback." },
278
279 { key = "light-black", default = "#514b45", description = "Bright ANSI 8 — text-muted." },
280 { key = "light-red", default = "#6a2828", description = "Bright ANSI 9." },
281 { key = "light-green", default = "#3a5830", description = "Bright ANSI 10." },
282 { key = "light-yellow", default = "#b07840", description = "Bright ANSI 11." },
283 { key = "light-blue", default = "#304050", description = "Bright ANSI 12." },
284 { key = "light-magenta", default = "#806080", description = "Bright ANSI 13." },
285 { key = "light-cyan", default = "#222d38", description = "Bright ANSI 14 — text-secondary." },
286 { key = "light-foreground", default = "#1a1816", description = "Bright foreground." },
287 ]
288
289 # -------------------------------------------------------------------
290 # Fields — bindings (list of tables)
291 # -------------------------------------------------------------------
292
293 [[field]]
294 path = "bindings.keys"
295 type = "list"
296 default = []
297 description = "Rio-scoped keybindings. Empty by default — Sway owns global binds; add entries here only for rio-internal actions (e.g. tab navigation if you turn navigation.mode on)."
298 element = { type = "table", fields = [
299 { path = "key", type = "string", required = true, description = "Keychord in rio syntax (e.g. \"ctrl+shift+t\")." },
300 { path = "action", type = "string", required = true, description = "Action to invoke (e.g. \"CreateTab\")." },
301 { path = "mode", type = "string", required = false, description = "Optional: restrict to a rio mode." },
302 ] }
303