Variables are the primary way to separate values from structure in RedEye configuration. Instead of hardcoding pixel sizes and color codes throughout dozens of XML files, you define named values once — in aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ryzhpolsos/redeye/llms.txt
Use this file to discover all available pages before exploring further.
<variables> block or an imported file — and reference them everywhere else with the ${varName} syntax. Changing a single variable propagates the new value across every widget that references it.
Defining variables
Use a<variables> block with one <set> element per variable. You can place a <variables> block anywhere inside <layout>, inside a <window>, or in any imported file:
taskbar.margin) is only a naming convention — dots have no special meaning to the parser.
Scoping
Variables are scoped to theConfigNode in which they are set and are visible to all descendant nodes. A variable set at the <layout> level is accessible everywhere inside the layout; a variable set inside a <window> is only accessible to that window’s children. Variable lookup walks up the node tree until it finds a match or reaches the root, at which point it returns an empty string.
Variables do not propagate upward. Setting a variable inside a child node does not affect the parent or its siblings.
Referencing variables
Use${variableName} in any attribute value or expression to substitute the variable’s current string value:
System variables
RedEye automatically sets two variables at startup, before any config files are processed:| Variable | Value |
|---|---|
screen.width | Total pixel width of all monitors combined (sum of all screen widths) |
screen.height | Total pixel height of all monitors combined (sum of all screen heights) |
Screen.AllScreens in Config.cs:
Both
screen.width and screen.height sum the corresponding dimension across all connected displays. On a multi-monitor setup this means they represent the full virtual desktop span. Plan your layout accordingly if you want to target only the primary monitor.Theme variables (theme.xml)
The file config/ui/theme.xml defines a shared set of design-token variables that are imported near the top of config.xml. All other UI files reference these tokens, making it possible to restyle the entire shell by editing one file:
Theme token reference
| Variable | Default | Usage |
|---|---|---|
theme.color.background | #13293d | Primary window background |
theme.color.backgroundChild | #2a628f | Secondary surface color (buttons, panels) |
theme.color.backgroundActive | #3e92cc | Hover and active state color |
theme.font.main | Segoe UI,10 | Default font for labels and buttons |
theme.font.color | #ffffff | Default text color |
theme.paddingLarge | 16 | Large spacing unit in pixels |
theme.paddingMiddle | 8 | Medium spacing unit in pixels |
theme.paddingSmall | 4 | Small spacing unit in pixels |
<variables> block placed after <import from="config/ui/theme.xml"/> will overwrite the defaults:
calc(...) — arithmetic expressions
The calc() function evaluates a mathematical expression string and returns the numeric result as a string. It is the standard way to compute derived sizes:
+, -, *, /) and variable substitutions. The result is always a string representation of a number.
Using calc() inline in attribute values
You can also use calc() directly in an attribute value without a <set>:
expand(...) — environment variable expansion
The expand() function calls Environment.ExpandEnvironmentVariables() on its argument, substituting %VARIABLE% placeholders with Windows environment variable values:
C:\Windows, since %SYSTEMROOT% resolves correctly regardless of the system drive.
Real-world variable example
The following shows the complete variable setup fromconfig.xml, illustrating how system variables, theme tokens, calc(), and expand() work together:
Using variables in widget events
Variable substitution also works in event handler attributes, where the values are evaluated at the time the event fires rather than at load time:${window.isActive} is a context variable injected by the <windowList> widget for each tracked window, and the if() function selects a theme color based on it.