$ show MonitorControl/MonitorControl
MonitorControl is a macOS menu-bar utility that controls external displays' brightness, contrast, and volume. It does not just send one kind of command; it uses multiple control paths: hardware DDC/CI over IOKit I2C on Intel Macs, DDC/CI over IOAVService on Apple Silicon, Apple's private DisplayServices API for Apple/Thunderbolt displays, gamma-ramp adjustments for software dimming, and transparent shade windows for virtual displays. User input flows from native media keys, custom keyboard shortcuts, and menu-bar sliders into a DisplayManager singleton, which coordinates native OSD overlays, smooth brightness transitions, and cross-display synchronization. The app uses Sparkle for updates, SimplyCoreAudio for audio device handling, MediaKeyTap for media-key interception, and KeyboardShortcuts for user-defined bindings. Architecturally, this is a classic Cocoa application with a storyboard-based preferences UI, a login helper app (MonitorControlHelper), and a clean separation between models (Display, AppleDisplay, OtherDisplay), support services (DisplayManager, DDC backends, OSD utilities, media-key handling), and view controllers for preferences and onboarding. Entry points are main.swift, AppDelegate, DisplayManager, and MenuHandler. Persistence is UserDefaults backed through a PrefKey enum, and the UI is localized into 19 languages. There is no data/research component; this is purely an end-user utility. The codebase is modular and well organized, with the DDC communication isolated into Intel and ARM backends and display-specific logic abstracted behind a base Display class. It is actively maintained, with recent commits and a modern dependency setup. Technical drift is medium rather than low because much of the functionality depends on private or undocumented macOS APIs (DisplayServices, CoreDisplay, OSDUIHelper) and the code contains many macOS-version-specific workarounds, but the project tracks current macOS releases and continues to update its fallbacks.
The LLM identified 4 files worth highlighting for reuse:
Implements low-level DDC/CI VCP read/write over IOKit I2C on Intel Macs, including retry logic, buffer splitting, and data validation. The class encapsulates the entire hardware protocol behind a compact read/write interface, so it can be extracted into a standalone DDC/CI library for macOS display tools.
Parallel DDC/CI backend for Apple Silicon using IOAVService. It demonstrates how non-obvious platform bifurcation can be isolated in a separate adapter while exposing the same API, making the rest of the app architecture-agnostic. Reusable for any macOS utility that needs hardware display control on newer Macs.
Custom NSSlider subclass (MCSlider/MCSliderCell) with tick marks, multi-display segment highlighting, percentage labels, and scroll-wheel support. It is a self-contained Cocoa UI component that can be lifted into other preference panes or toolbars without needing the rest of the application.
Base display model that manages gamma-table caching, software brightness calculations, and smooth transition animations. The gamma restore/apply logic and timer-based interpolation are generic techniques useful in display calibration, accessibility, or screen-dimming libraries.