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.

The media.* family of expression functions gives your shell configuration direct control over hardware-level system settings: screen brightness via WMI, audio volume via the Windows Core Audio API, and battery charge level via WMI. These functions integrate naturally into onClick attributes on buttons, action attributes on hotkeys, or polling widgets that display live system state.
Brightness control requires a WMI-compatible monitor driver (WmiMonitorBrightness). On desktop systems without a supported display driver, media.getBrightness() returns -1 and media.setBrightness() throws an exception. Battery functions return -1 on systems without a battery.

Brightness

Reads the current screen brightness from the WMI monitor brightness provider.Returns: An integer string from 0 to 100 representing the current brightness percentage, or -1 if the display driver does not support WMI brightness control.
<!-- Display current brightness in a label -->
<label text="concat('Brightness: ', media.getBrightness(), '%')"/>
Sets the screen brightness to an absolute level.
value
number
required
Target brightness level as an integer from 0 (minimum) to 100 (maximum).
Returns: An empty string.
<!-- Set brightness to 80% on button click -->
<button text="Bright" onClick="media.setBrightness(80)"/>
Increases the screen brightness by a fixed step. If step is not provided, the default increment is 10.
step
number
The number of percentage points to add to the current brightness. Defaults to 10.
Returns: An empty string.
<!-- Increase brightness by 10 (default) -->
<button text="+" onClick="media.increaseBrightness()"/>

<!-- Increase by a custom step -->
<button text="+5" onClick="media.increaseBrightness(5)"/>
Decreases the screen brightness by a fixed step. If step is not provided, the default decrement is 10.
step
number
The number of percentage points to subtract from the current brightness. Defaults to 10.
Returns: An empty string.
<!-- Decrease brightness by 10 (default) -->
<button text="-" onClick="media.decreaseBrightness()"/>

<!-- Decrease by a custom step -->
<button text="-20" onClick="media.decreaseBrightness(20)"/>

Brightness hotkeys

You can bind brightness controls directly in keyBindings.xml:
<hotkeys>
    <hotkey keys="Win+F5" action="media.decreaseBrightness()"/>
    <hotkey keys="Win+F6" action="media.increaseBrightness()"/>
</hotkeys>

Volume

Reads the current master volume level of the default audio output device via the Windows Core Audio API.Returns: An integer string from 0 to 100 representing the current volume percentage.
<!-- Display current volume in a tray label -->
<label text="concat('Vol: ', media.getVolume(), '%')"/>
Sets the master volume of the default audio output device to an absolute level.
value
number
required
Target volume level as an integer from 0 (silent) to 100 (maximum).
Returns: An empty string.
<!-- Mute by setting volume to zero -->
<button text="Mute" onClick="media.setVolume(0)"/>

<!-- Set to 50% -->
<button text="50%" onClick="media.setVolume(50)"/>
Increases the master volume by a fixed step. If step is not provided, the default increment is 10.
step
number
The number of percentage points to add to the current volume. Defaults to 10.
Returns: An empty string.
<!-- Volume up button -->
<button text="▲" onClick="media.increaseVolume()"/>

<!-- Fine-grained control -->
<button text="+2" onClick="media.increaseVolume(2)"/>
Decreases the master volume by a fixed step. If step is not provided, the default decrement is 10.
step
number
The number of percentage points to subtract from the current volume. Defaults to 10.
Returns: An empty string.
<!-- Volume down button -->
<button text="▼" onClick="media.decreaseVolume()"/>

<!-- Fine-grained control -->
<button text="-2" onClick="media.decreaseVolume(2)"/>

Volume hotkeys

<hotkeys>
    <hotkey keys="Win+F9"  action="media.decreaseVolume()"/>
    <hotkey keys="Win+F10" action="media.increaseVolume()"/>
    <hotkey keys="Win+F11" action="media.setVolume(0)"/>
</hotkeys>

Battery

Reads the estimated remaining battery charge from Win32_Battery via WMI.Returns: An integer string from 0 to 100 representing the remaining charge percentage, or -1 if no battery is present (e.g., on a desktop system).
<!-- Show battery level in the system tray -->
<label text="concat(media.getBatteryLevel(), '%')"/>
Check for -1 before displaying to avoid showing a meaningless value on desktops: ife(eq(media.getBatteryLevel(), '-1'), 'N/A', concat(media.getBatteryLevel(), '%'))

Full tray widget example

The following example shows how to compose a compact media control row using buttons wired to media functions, suitable for inclusion in a system tray area:
<!-- Brightness controls -->
<panel dock="fill" height="24">
    <label text="concat(media.getBrightness(), '%')" width="40" align="middleCenter"/>
    <button text="-" width="24" onClick="media.decreaseBrightness()" toolTip="Decrease brightness"/>
    <button text="+" width="24" onClick="media.increaseBrightness()" toolTip="Increase brightness"/>
</panel>

<!-- Volume controls -->
<panel dock="fill" height="24">
    <label text="concat(media.getVolume(), '%')" width="40" align="middleCenter"/>
    <button text="-" width="24" onClick="media.decreaseVolume()" toolTip="Decrease volume"/>
    <button text="+" width="24" onClick="media.increaseVolume()" toolTip="Increase volume"/>
</panel>

<!-- Battery indicator (laptop only) -->
<label text="concat('BAT ', media.getBatteryLevel(), '%')" dock="fill"/>

Expression functions

General-purpose functions: math, strings, process launching.

Window functions

Control shell and system windows by handle.

Hotkeys

Bind media functions to keyboard shortcuts.

Build docs developers (and LLMs) love