diff options
| author | anders130 <93037023+anders130@users.noreply.github.com> | 2025-08-30 04:52:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-30 12:52:52 +1000 |
| commit | d69a400f9f30747166560f8badcd4d3c5356897b (patch) | |
| tree | 500819a7d907701d0109e2c16f440f1551acc496 /services | |
| parent | nix/hm: add option to disable systemd service (#526) (diff) | |
| download | caelestia-shell-d69a400f9f30747166560f8badcd4d3c5356897b.tar.gz caelestia-shell-d69a400f9f30747166560f8badcd4d3c5356897b.tar.bz2 caelestia-shell-d69a400f9f30747166560f8badcd4d3c5356897b.zip | |
brightness: detect monitors by connector instead of model (#503)
* fix(brightness): change monitor detection to be based on connector
using the model caused problems when using the same monitor twice
* format + use connector for isDdc
---------
Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Diffstat (limited to 'services')
| -rw-r--r-- | services/Brightness.qml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/services/Brightness.qml b/services/Brightness.qml index 086bc65..fe564cc 100644 --- a/services/Brightness.qml +++ b/services/Brightness.qml @@ -60,8 +60,8 @@ Singleton { command: ["ddcutil", "detect", "--brief"] stdout: StdioCollector { onStreamFinished: root.ddcMonitors = text.trim().split("\n\n").filter(d => d.startsWith("Display ")).map(d => ({ - model: d.match(/Monitor:.*:(.*):.*/)[1], - busNum: d.match(/I2C bus:[ ]*\/dev\/i2c-([0-9]+)/)[1] + busNum: d.match(/I2C bus:[ ]*\/dev\/i2c-([0-9]+)/)[1], + connector: d.match(/DRM connector:\s+(.*)/)[1].replace(/^card\d+-/, "") // strip "card1-" })) } } @@ -82,8 +82,8 @@ Singleton { id: monitor required property ShellScreen modelData - readonly property bool isDdc: root.ddcMonitors.some(m => m.model === modelData.model) - readonly property string busNum: root.ddcMonitors.find(m => m.model === modelData.model)?.busNum ?? "" + readonly property bool isDdc: root.ddcMonitors.some(m => m.connector === modelData.name) + readonly property string busNum: root.ddcMonitors.find(m => m.connector === modelData.name)?.busNum ?? "" readonly property bool isAppleDisplay: root.appleDisplayPresent && modelData.model.startsWith("StudioDisplay") property real brightness property real queuedBrightness: NaN |