A macOS background agent that keeps a Dell U3225QE monitor's brightness in sync with the MacBook built-in display.
The agent polls the built-in panel brightness every 200 ms and writes the mapped value to the Dell monitor over DDC/CI. It only sends a write when the target brightness actually changes, keeping steady-state CPU and DDC traffic near zero.
Brightness is mapped through piecewise linear interpolation over measured calibration points rather than a naive linear scale, so perceived brightness stays matched across the range.
Requires Rust (2024 edition) and macOS.
cargo build --release
A launchd plist is provided at launchd/dev.monitor-control.agent.plist. To install:
- Edit the plist and replace
REPLACE_WITH_ABSOLUTE_BINARY_PATHwith the path to the built binary. - Copy it to
~/Library/LaunchAgents/. - Load the agent:
launchctl load ~/Library/LaunchAgents/dev.monitor-control.agent.plist
The agent starts at login and launchd restarts it if it exits.
The agent stays resident and recovers in place rather than exiting on failure:
- If the built-in display is unavailable, it retries each poll cycle.
- If the Dell monitor is unavailable or a DDC write fails, it backs off (1 s, 2 s, 4 s, capped at 5 s) and re-discovers the monitor.
- Discovery and write failures track separate backoff streaks.
Set the log level with RUST_LOG (default: info). Logs go to stderr, which the plist routes to /tmp/monitor-control.stderr.log.
MIT