mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
fix(brightness): handle DRM_connector format in ddcutil output
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 is contained in:
@@ -104,7 +104,7 @@ Singleton {
|
||||
var ddcModelMatch = d.match(/(This monitor does not support DDC\/CI|Invalid display)/);
|
||||
var modelMatch = d.match(/Model:\s*(.*)/);
|
||||
var busMatch = d.match(/I2C bus:[ ]*\/dev\/i2c-([0-9]+)/);
|
||||
var connectorMatch = d.match(/DRM connector:\s*card\d+-(.+)/);
|
||||
var connectorMatch = d.match(/DRM[_ ]connector:\s*card\d+-(.+)/);
|
||||
var ddcModel = ddcModelMatch ? ddcModelMatch.length > 0 : false;
|
||||
var model = modelMatch ? modelMatch[1] : "Unknown";
|
||||
var bus = busMatch ? busMatch[1] : "Unknown";
|
||||
|
||||
Reference in New Issue
Block a user