alin23/Lunar
45.8
Weak · 30 September 2026
48.3k
lines of production code
Swift
primary language
2
measurements over time
What this system is
Lunar is a macOS application designed to manage display brightness, contrast, and color settings through a unified control architecture supporting native Apple APIs, DDC/CI, and networked devices. It features adaptive modes driven by ambient light sensors, location, and time, alongside specialized capabilities like XDR management, BlackOut mode for GPU resource saving, and Sidecar integration. The system also provides a command-line interface, macOS Shortcuts automation, and firmware installation tools for DIY hardware sensors.
How it got here
2017 — Lunar rebranding and initial structure
12 changes.
The project was rebranded from Adaptivo to Lunar, involving the removal of legacy macOS scaffolding and the establishment of a new repository structure with build tooling. This period focused on laying the foundational UI, implementing core settings controllers, and stabilizing the DDC communication layer by reverting to C.
2018–2023 — Architecture modernization and feature expansion
17 changes.
This period focused on restructuring the application's core architecture by introducing unified protocols for display control, modes, and utilities, while migrating the UI to SwiftUI. It also expanded functionality through the addition of ambient light sensor support, macOS Shortcuts integration, and comprehensive build automation, alongside significant security updates like EdDSA authentication.
Features
Add bundled libssh2 library and new data models for CLI and app exceptions
The Lunar/Data area now includes the libssh2 C library (version 1.9.0) with its public key and SFTP headers, exposed via a Swift module map, alongside new Swift data models for CLI command handling (CLI.swift) and per-application brightness/contrast overrides (AppException.swift). These additions provide the underlying SSH/SFTP connectivity and structured data storage required for the expanded command-line interface and app-specific display settings.
Lunar/Data · high confidence
Add firmware installer and configuration for DIY ambient light sensors
This change introduces a new \Lunar/ALS\ directory containing an automated installation script (\install.sh\) and ESPHome configuration templates for various ambient light sensors (including BH1750, LTR390, MAX44009, TCS34725, TSL2561, and TSL2591). The installer supports multiple ESP32 and ESP8266 boards (such as NodeMCU, Adafruit Metro, and SparkFun Thing Plus) by automatically configuring I2C pins and platform versions, allowing users to easily deploy custom light-sensing hardware to the Lunar ecosystem.
Lunar/ALS · high confidence
Added Lunar Utils library with display control, networking, and UI utilities
The Lunar/Utils directory now includes a comprehensive set of utility modules supporting core application functionality. DisplayController.swift introduces advanced display management, including DCP/AVService matching for M1/M2 Macs, EDID UUID matching, and hardware-level brightness/contrast control. Ciao.swift provides mDNS/Bonjour service discovery for networked devices, while Solar.swift adds astronomical calculations for location-based ambient light sensing. Additional utilities include LoginServiceKit for login item management, Swizzle.swift for customizing popover appearances, and Trap.swift for OS signal handling.
Lunar/Utils · high confidence
Automated Lunar.app installation and cleanup scripts
Added postinstall and preinstall shell scripts to manage the Lunar application installation. The preinstall script removes any existing Lunar.app to ensure a clean state, while the postinstall script handles migration from a localized version (Lunar.localized/Lunar.app) to the standard location, removing the localized directory if the migration occurs.
scripts · high confidence
Initial gitsecret key and path mappings added
The repository now includes initial configuration files for gitsecret to manage encrypted secrets. A new empty key mapping file and a path mapping file have been added, linking specific source files (such as Lunar/Resources/eddsa\_priv, Lunar/Data/Pro.swift, and Lunar/DDC/DDC2.c) to their corresponding encrypted key IDs.
.gitsecret · high confidence
Initial repository structure and build tooling
This change establishes the foundational project structure for Lunar, introducing essential build and development infrastructure. It adds a \.gitignore\ file to exclude build artifacts, frameworks, and sensitive keys, and configures Git submodules for dependencies including WAYWindow, NSPageControl, Sparkle, MLKit, and Shout. A \Makefile\ is provided to automate building, packaging, and generating appcast updates via Sparkle, while \.pre-commit.sh\ and \.swiftformat\ enforce code style using SwiftFormat. The repository also includes a \CHANGELOG.md\ documenting versions from 6.9.10 down to 6.8.0, a \LICENSE\ file under the MIT license, and a \README.md\ describing the app's features such as DDC/CI control, XDR brightness, and BlackOut mode.
(repo-wide) · high confidence
Initial storyboard release for Lunar
The main application interface (Main.storyboard) has been added to the project, establishing the foundational UI structure including the main menu, application menu, and edit menu. This change introduces the base layout for the macOS application, replacing any previous or missing storyboard definitions with a complete, versioned interface file.
Lunar/Base.lproj · high confidence
Introduction of Adaptive Mode architecture with Manual Mode implementation
The Lunar/Modes component now features a new \AdaptiveMode\ protocol and \AdaptiveModeKey\ enum, establishing a unified framework for display modes including Sensor, Location, Sync, Clock, and Auto. This change introduces the \ManualMode\ class, which implements this protocol to handle direct brightness and contrast adjustments, including support for app-specific presets and system adaptive brightness toggling. This provides the foundational structure for the application's mode-switching logic.
Lunar/Modes · high confidence
New controller views for settings, sensors, and DDC configuration
The application now includes dedicated view controllers for configuring ambient light sensor installation, DDC/CI parameters (such as min/max brightness and volume limits), and general display settings. These controllers provide users with a structured interface to manage hardware-specific options, sensor polling intervals, and input hotkeys, replacing or supplementing previous configuration methods.
Lunar/Controllers · high confidence
New header files for Sidecar, CoreBrightness, and login items
The Lunar/Headers directory now includes new interface definitions for Sidecar display management (Bridge.h), CoreBrightness adaptation and blue-light controls (CBAdaptationClient.h, CBBlueLightClient.h, CBTrueToneClient.h), keyboard brightness (KeyboardBrightnessClient.h), and launch-at-login behavior (LaunchAtLoginController.h). These headers expose the APIs required to manage external Sidecar displays, adjust screen adaptation and blue-light modes, control keyboard backlight, and handle login items, laying the groundwork for the app's display and system integration features.
Lunar/Headers · high confidence
macOS Shortcuts integration for display control
Lunar now supports macOS Shortcuts, allowing users to automate display adjustments via the App Intents framework. This update introduces a new \LunarShortcuts\ module that exposes screen entities and properties (such as brightness, contrast, HDR, and XDR status) to the Shortcuts app, enabling users to create custom workflows for managing monitor settings directly from their automation tools.
LunarShortcuts · high confidence
Removals
Removed default Xcode project scaffolding and test targets
The default iOS application structure, including the main app target and its associated unit and UI test bundles, has been removed from the project. This deletion eliminates the standard boilerplate files such as AppDelegate, ViewController, Main.storyboard, and the corresponding empty test cases (AdaptivoTests and AdaptivoUITests), effectively stripping the project of its initial template content.
Adaptivo.xcodeproj, AdaptivoTests, AdaptivoUITests · high confidence
Removed legacy macOS app scaffolding
The default macOS application entry points and interface definitions have been removed. Specifically, the \AppDelegate.swift\, \ViewController.swift\, \Main.storyboard\, and \Info.plist\ files that constituted the initial project template are no longer present, indicating the removal of the standard Cocoa application structure.
Adaptivo · high confidence
Architecture
Introduce unified display control architecture with native Apple and DDC implementations
Lunar now uses a structured control system where display adjustments are handled by specific implementations (AppleNative, DDC, DDCCTL, Gamma, Network) conforming to a common Control protocol. This change introduces AppleNativeControl for direct macOS brightness management via DisplayServices and CoreDisplay, DDCControl for standard DDC/CI communication, and DDCCTLControl as a wrapper for the external ddcctl binary, providing a consistent interface for brightness, contrast, color gains, and power state across all supported display technologies.
Lunar/Control · high confidence
New build and release automation scripts
The build process now includes new shell scripts in the bin directory to handle code signing, notarization, and installer creation. Specifically, the \sign\ script applies Developer ID signing to application binaries and frameworks, while \make-installer\ and \pack\ automate the creation of signed .dmg and .pkg installers, including notarization via \xcrun notarytool\. Additionally, \buildscript.sh\ integrates Sentry debug symbol uploads, and \sign\_update\_dsa\ handles DSA signature generation for Sparkle updates.
bin · high confidence
Behavioural changes
Added Lunar workspace configuration
A new workspace file (Lunar.xcworkspace) has been created to manage the project, referencing the main Lunar.xcodeproj. This allows for easier management of multiple targets or shared schemes within the development environment.
Lunar.xcworkspace · high confidence
App hang detection and Sentry error reporting
Lunar now includes built-in app hang detection that monitors the main thread and can automatically disable Core Location if repeated hangs are detected, alongside integration with Sentry for crash and error reporting. This allows the application to recover from unresponsive states and provides developers with diagnostic data to improve stability.
Lunar · high confidence
Migration to EdDSA key for authentication
The application has replaced the previous DSA public key with a new EdDSA public key. This change updates the cryptographic material used for verification, ensuring that the app now relies on the EdDSA algorithm for its security checks.
Lunar/Resources · high confidence
New SwiftUI settings and control views for BlackOut, XDR, and display management
The application's settings and control interfaces have been rebuilt using SwiftUI, introducing dedicated views for advanced configuration and display controls. Users can now access granular BlackOut options, including a new method to disconnect screens to free GPU resources on Apple Silicon (macOS 13+), alongside legacy mirroring fallbacks. The XDR and HDR settings view exposes the new 'Full Range' algorithm for MacBook screens, which prevents color clipping and maintains system adaptive brightness, along with ambient light sensor controls for automatic XDR toggling. Additionally, new views manage display rows with context menus for features like FaceLight and Night Shift overrides, handle disconnected display reconnection, and provide a unified quick-actions layout for sliders, presets, and power controls.
Lunar/SwiftUIViews · high confidence
Project renamed from Adaptivo to Lunar
The Xcode project has been renamed from Adaptivo to Lunar. This change includes updating the project file references, workspace configuration, and scheme management to reflect the new product name, effectively rebranding the application within the development environment.
Lunar.xcodeproj · high confidence
Redesigned adaptive mode selection and settings UI components
The application introduces a new \AdaptiveModeButton\ for selecting brightness modes, which now displays specific reasons for mode unavailability (such as missing location permissions, no light sensor, or BlackOut conflicts) directly in the menu item text and tooltips. This is supported by a suite of new SwiftUI and AppKit view components—including \SettingsToggle\, \BrightnessContrastChartView\, \HotKeyView\, and \DisplayName\—along with a dedicated \Colors.swift\ file that defines a comprehensive theming system with dynamic light/dark mode support, enabling a more consistent and informative user interface for display configuration.
Lunar/Views · high confidence
Revert DDC implementation to C for stability
The DDC communication layer in Lunar has been reverted from Swift back to a C implementation (DDC.c, DDC.h, SharedDDC.h) to resolve crashes and deadlocks. This change restores the original low-level I/O Kit and CoreGraphics interactions for reading EDID data and writing DDC commands, ensuring more reliable monitor control and preventing the application hangs associated with the previous Swift-based approach.
Lunar/DDC · high confidence
Workspace configuration reset and migration
The project workspace settings have been updated to use a clean, default configuration. The previous scheme management data from the old project structure has been replaced with a standard workspace check file, effectively removing custom scheme ordering and ensuring consistent workspace behavior across different development environments.
Lunar.xcworkspace/xcshareddata · medium confidence
Dependencies
Updated Swift package dependencies and added Python requirements
The project's Swift Package Manager resolved files (Package.resolved) have been updated, pinning specific versions for dependencies such as DataCompression (3.8.0 to 3.9.0), Path.swift (1.4.1 to 1.6.0), swift-algorithms (1.2.0 to 1.2.1), swift-argument-parser (1.4.0 to 1.7.1), and swift-atomics (1.2.0 to 1.3.0). Additionally, a new requirements.txt file has been introduced, adding Python dependencies: fire, lxml, markdown2, pygments, and md2html-phuker.
(dependencies) · high confidence
Housekeeping
Added Xcode scheme configurations for AnyCodable playgrounds; Added developer debugger configuration files; Added placeholder file for Frameworks directory; Added placeholder files for localization folders; Release notes for versions 1.0.1 through 5.2.1.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 50 → 46 (-4.3)
- Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 80 → 82 (+1.8)
- Architecture 92 → 77 (-14.9)
- Maturity 56 → 57 (+0.8)
- Readiness 24 → 24 (-0.3)
- Security 93 → 96 (+2.7)
- Performance 61 (new)
Resolved (3)
- Change coupling: QuickActionsViewController.swift ↔ Display.swift (Lunar/Controllers/QuickActionsViewController.swift)
- Hotspot: Lunar/AppDelegate.swift (Lunar/AppDelegate.swift)
- Hotspot: Lunar/Utils/DisplayController.swift (Lunar/Utils/DisplayController.swift)
New (143)
- AdvancedSettingsView.body (cognitive 16) (Lunar/SwiftUIViews/AdvancedSettingsView.swift)
- AppDelegate.swift.installCLIBinary (cognitive 16) (Lunar/AppDelegate.swift)
- Banned license: markdown-link-attr-modifier
- Banned license: md2html-phuker
- BigSurSlider.body (cognitive 30) (Lunar/Views/OSDWindow.swift)
- BigSurSlider.body (cyclomatic 27) (Lunar/Views/OSDWindow.swift)
- CLI.swift.encodedValue (cognitive 21) (Lunar/Data/CLI.swift)
- CLI.swift.encodedValue (cyclomatic 19) (Lunar/Data/CLI.swift)
- CLI.swift.getFilteredDisplays (cognitive 17) (Lunar/Data/CLI.swift)
- CLI.swift.getFilteredDisplays (cyclomatic 25) (Lunar/Data/CLI.swift)
- CLI.swift.handleDisplays (cognitive 138) (Lunar/Data/CLI.swift)
- CLI.swift.handleDisplays (cyclomatic 65) (Lunar/Data/CLI.swift)
- CLI.swift.printDisplay (cognitive 33) (Lunar/Data/CLI.swift)
- CLI.swift.printDisplay (cyclomatic 23) (Lunar/Data/CLI.swift)
- Display.active (cognitive 34) (Lunar/Data/Display.swift)
- Display.active (cyclomatic 24) (Lunar/Data/Display.swift)
- Display.audioMuted (cognitive 16) (Lunar/Data/Display.swift)
- Display.brightness (cognitive 53) (Lunar/Data/Display.swift)
- Display.brightness (cyclomatic 49) (Lunar/Data/Display.swift)
- Display.contrast (cognitive 27) (Lunar/Data/Display.swift)
- …and 123 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
alin23/Lunar was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 8a21ffe302a00890d9f5d5101536cdd2a4631be8 — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.