Skip to main content

Documentation 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.

Expression functions are the primary way to add dynamic behavior to your RedEye shell configuration. You can call them directly in any RWML attribute value or inside an <eval> block, and they receive resolved arguments — meaning you can nest function calls and variable references freely.

How expressions work

RedEye evaluates two kinds of expressions in RWML:
  • Variable substitution${varName} is replaced with the current value of varName from the variable store.
  • Function callsfuncName(arg1, arg2) invokes a registered expression function with the given arguments. Arguments can be quoted strings ('hello'), raw strings ({hello}), variable references, or nested function calls.
<!-- Variable substitution -->
<label text="${theme.font.color}"/>

<!-- Function call in an attribute -->
<panel backgroundColor="if(${window.isActive}, ${theme.color.backgroundActive}, ${theme.color.backgroundChild})"/>

<!-- Nested calls -->
<label text="concat('Width: ', calc('${taskbar.width} - ${taskbar.tray.width}'))"/>
String arguments use single quotes ('like this'). Raw strings use curly braces ({like this}) and are never variable-substituted. Backtick (`) is the escape character inside strings.

Math and evaluation

Evaluates a mathematical expression string and returns the result as a string.
expr
string
required
A math expression to evaluate. Supports standard arithmetic operators: +, -, *, /, and parentheses.
Returns: The numeric result as a string.
<label text="eval('2 + 2')"/>
<!-- Renders: 4 -->

<panel width="eval('${taskbar.width} - 48')"/>
Alias for eval. Evaluates a mathematical expression string and returns the result.
expr
string
required
A math expression to evaluate. Same syntax as eval.
Returns: The numeric result as a string.
<panel width="calc('${taskbar.width} - ${taskbar.tray.width} - ${taskbar.item.size}')"/>
calc is the conventional alias used in layout attributes where a width or position depends on other variable values.

Conditional logic

Returns one of two literal string values based on whether condition evaluates to true.
condition
string
required
A math expression that evaluates to a truthy or falsy value. Non-zero numbers and the string "true" are truthy.
trueVal
string
required
The literal string to return when the condition is true.
falseVal
string
The literal string to return when the condition is false. If omitted, returns an empty string.
Returns: trueVal or falseVal as a literal string (not evaluated further).
<!-- Change background color based on whether a window is active -->
<panel backgroundColor="if(${window.isActive}, ${theme.color.backgroundActive}, ${theme.color.backgroundChild})"/>
Arguments to if are returned as-is — they are not evaluated as expressions. Use ife if you need the branches to be evaluated.
Conditional that evaluates the chosen branch as a full RWML expression before returning it.
condition
string
required
A math expression that evaluates to a truthy or falsy value.
trueExpr
string
required
An RWML expression string to evaluate and return when the condition is true.
falseExpr
string
An RWML expression string to evaluate and return when the condition is false. If omitted, returns an empty string.
Returns: The result of evaluating the selected branch expression.
<!-- Call a function only when a condition is met -->
<label text="ife(${media.muted}, 'concat(Muted: , ${media.getVolume()})', ${media.getVolume()})"/>

Variables

Retrieves a variable value from the variable store by name. Useful when the variable name is itself dynamic.
name
string
required
The name of the variable to retrieve.
Returns: The current value of the named variable, or an empty string if not found.
<label text="getvar('theme.font.color')"/>
<!-- Equivalent to: ${theme.font.color} -->
Reads a named field or property from a resource object registered in the resource store.
resourceId
string
required
The identifier of the resource object to inspect.
fieldName
string
required
The name of the public field or property to read from the resource object.
Returns: The string representation of the field/property value, or an empty string if not found.
<label text="get('myBitmap', 'Width')"/>

String utilities

Compares two values for string equality.
a
string
required
The first value.
b
string
required
The second value.
Returns: The string "true" if a and b are equal, otherwise "false".
<panel backgroundColor="if(eq(${window.state}, 'active'), #ff0000, #333333)"/>
Concatenates any number of strings with no separator.
str1, str2, ...
string
required
One or more strings to concatenate in order.
Returns: All arguments joined into a single string.
<label text="concat('Hello, ', ${user.name}, '!')"/>
Joins multiple strings with a separator between each value.
separator
string
required
The string to place between each item.
str1, str2, ...
string
required
One or more strings to join.
Returns: All arguments after the separator joined with the separator between them.
<label text="join(', ', 'one', 'two', 'three')"/>
<!-- Renders: one, two, three -->
Returns the current local date and time formatted according to a .NET format string.
format
string
required
A standard or custom .NET date/time format string (e.g., HH:mm, dd/MM/yyyy, ddd MMM d).
Returns: The current date and time as a formatted string.
<!-- Display a live clock (when used in a polling widget) -->
<label text="dateTime('HH:mm')"/>

<!-- Full date -->
<label text="dateTime('dddd, MMMM d')"/>
Expands Windows environment variable references in a string (e.g., %USERPROFILE%).
path
string
required
A string containing one or more %VARIABLE% environment variable placeholders.
Returns: The input string with all environment variables expanded to their current values.
<label text="expand('%USERPROFILE%\\Documents')"/>
Generates a new random GUID.Returns: A GUID string in the standard xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format.
<label text="guid()"/>
<!-- Example: 3f2504e0-4f89-11d3-9a0c-0305e82c3301 -->

Dialogs

Displays a modal Windows message box with the given text. The box is shown on a background thread so it does not block the UI.
text
string
required
The message text to display.
Returns: An empty string.
<button text="Info" onClick="showMessage('RedEye is running!')"/>

Process launching

Launches a process or opens a file/URL using the system shell. Errors are reported in a message box.
fileName
string
required
The path to the executable, file, or URL to open.
args
string
Optional command-line arguments to pass to the process.
Returns: An empty string.
<!-- Open a terminal -->
<hotkey keys="Win+T" action="shellExecute('cmd.exe')"/>

<!-- Open the default browser -->
<hotkey keys="Win+B" action="shellExecute('http:')"/>

<!-- Launch an app from the start menu app list -->
<panel onClick="shellExecute(${app.command})"/>
Launches a process silently: no window is created and the process is not shown in the taskbar. Errors are silently swallowed.
fileName
string
required
The path to the executable to run.
args
string
Optional command-line arguments to pass to the process.
Returns: An empty string.
<!-- Lock the workstation silently -->
<button text="Lock" onClick="shellExecuteHidden('rundll32.exe', 'user32,LockWorkStation')"/>

<!-- Log off -->
<button text="Log off" onClick="shellExecuteHidden('shutdown.exe', '/l')"/>
Unlike shellExecute, errors from shellExecuteHidden are silently ignored. Verify your command independently if it fails to execute.

System configuration

Sets the Windows work area — the region of the screen that is not covered by the taskbar or other always-on-top shell elements. Call this once when your taskbar window finishes loading to reserve its screen space.
x
number
required
Left edge of the work area in pixels.
y
number
required
Top edge of the work area in pixels.
width
number
required
Width of the work area in pixels.
height
number
required
Height of the work area in pixels.
Returns: An empty string.
<!-- Reserve the top of the screen for a 32px taskbar -->
<window onLoad="setWorkArea(0, 32, ${screen.width}, calc('${screen.height} - 32'))"/>

Resource loading

Loads an image file into the resource store and returns a resource identifier that can be used as an src attribute value. Optionally resizes the image on load.
path
string
required
Path to the image file, relative to the RedEye configuration directory.
width
number
Target width in pixels. Must be provided together with height to resize.
height
number
Target height in pixels. Must be provided together with width to resize.
Returns: A resource identifier string that can be passed to src attributes.
<image src="res.loadImage('images/wallpaper.png')"/>

<!-- Load and resize -->
<image src="res.loadImage('images/logo.png', 32, 32)"/>
Extracts an icon from an executable or icon file and loads it as a bitmap resource.
path
string
required
Path to the .exe, .dll, or .ico file to extract the icon from.
index
number
Zero-based index of the icon to extract. Defaults to 0.
Returns: A resource identifier string that can be passed to src attributes.
<image src="res.loadIcon('%SystemRoot%\\system32\\shell32.dll', 3)"/>

COM messaging

Sends a key/value message to a registered COM listener identified by target. Additional key/value pairs are passed as the message payload.
target
string
required
The identifier of the registered COM message receiver.
key1, val1, ...
string
Zero or more key/value pairs to include in the message payload. Arguments must come in pairs.
Returns: An empty string.
<button onClick="com.sendMessage('myPlugin', 'action', 'refresh', 'source', 'button')"/>

Shell lifecycle

Restarts the RedEye shell process. The current process is killed via taskkill and a new instance is started immediately.Returns: An empty string (the process terminates before returning).
<button text="Restart shell" onClick="shell.restart()"/>
All unsaved state is lost when the shell restarts. Ensure your configuration is saved to disk before calling this function.

Window functions

Control shell and system windows.

Media functions

Control brightness, volume, and battery.

Hotkeys

Bind expression functions to keyboard shortcuts.

Build docs developers (and LLMs) love