From 031cb3311d2e451d82ed2a2e2cc8bdc4c1545ff7 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 24 Sep 2026 11:38:12 +0200 Subject: ... --- .../gkleen@skadhi/shell/quickshell/Services/Brightness.qml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'accounts') diff --git a/accounts/gkleen@skadhi/shell/quickshell/Services/Brightness.qml b/accounts/gkleen@skadhi/shell/quickshell/Services/Brightness.qml index 1f133f01..fc7a5355 100644 --- a/accounts/gkleen@skadhi/shell/quickshell/Services/Brightness.qml +++ b/accounts/gkleen@skadhi/shell/quickshell/Services/Brightness.qml @@ -12,15 +12,14 @@ Singleton { property string subsystem: "backlight" property string device: "amdgpu_bl1" - property real deadzone: 5268 property real currBrightness property real exponent: 1 function calcCurrBrightness() { if (!currFile.loaded || !maxFile.loaded) return undefined; - const curr = Number(currFile.text()) - deadzone; - const max = Number(maxFile.text()) - deadzone; + const curr = Number(currFile.text()); + const max = Number(maxFile.text()); const val = Math.pow(curr / max, 1 / root.exponent); return val; } @@ -49,15 +48,15 @@ Singleton { if (typeof prev === 'undefined' || Math.abs(root.currBrightness - prev) < 0.01) return; - const max = Number(maxFile.text()) - deadzone; - const actual = Number(currFile.text()) - deadzone; + const max = Number(maxFile.text()); + const actual = Number(currFile.text()); let curr = Math.max(0, Math.min(max, Math.pow(root.currBrightness, root.exponent) * max)); if (Math.round(curr) == actual && curr < actual) curr = Math.max(0, actual - 1); else if (Math.round(curr) == actual && curr > actual) curr = Math.min(max, actual + 1); // root.currBrightness = Math.pow(curr / max, 1 / root.exponent); - Custom.Systemd.setBrightness(root.subsystem, root.device, Math.round(curr) + deadzone); + Custom.Systemd.setBrightness(root.subsystem, root.device, Math.round(curr)); } FileView { -- cgit v1.2.3