- BrightnessService: Add onIsDdcChanged handler to fetch brightness
when DDC is detected at startup
- BrightnessService: Fix condition to update brightness when value is 0
- BrightnessPanel: Refresh DDC brightness when panel opens
- BrightnessCard: Fix timer to only run on user interaction (not continuously)
Fixes#1427
The regex for parsing DRM connector from ddcutil output only matched
"DRM connector:" (with space), but newer versions of ddcutil output
"DRM_connector:" (with underscore).
This caused the connector field to be empty for all DDC monitors,
making it impossible to distinguish between multiple identical
monitors (e.g., two "Mi Monitor" displays on DP-2 and DP-3).
The fix uses a character class [_ ] to match both formats.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit addresses two issues with DDC monitor brightness:
1. **Added 30-second polling timer for DDC monitors**
- DDC monitors don't emit change events when brightness is changed
externally (via physical buttons or other applications)
- New pollTimer automatically refreshes DDC brightness every 30 seconds
- Timer respects active brightness changes (doesn't poll during user adjustments)
2. **Fixed refreshBrightnessFromSystem() parser**
- Previously only parsed internal display format (2-line current/max)
- Now correctly handles all three display types:
* DDC: "VCP 10 C 100 100" (space-separated)
* Apple: Single integer "100"
* Internal: Two lines "current\nmax"
- Unified parsing logic reduces code duplication
3. **Minor improvements**
- Simplified increase/decrease brightness logic
- Added debug logging for refresh operations
- Removed NaN initialization for brightness property
Tested with DDC external monitor (MSI MAG401QR) on Hyprland.
🤖 Generated with Claude Code