summaryrefslogtreecommitdiff
path: root/accounts/gkleen@skadhi
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@skadhi')
-rw-r--r--accounts/gkleen@skadhi/shell/quickshell/Services/Brightness.qml7
1 files changed, 4 insertions, 3 deletions
diff --git a/accounts/gkleen@skadhi/shell/quickshell/Services/Brightness.qml b/accounts/gkleen@skadhi/shell/quickshell/Services/Brightness.qml
index 76e8c08d..2d7b2e01 100644
--- a/accounts/gkleen@skadhi/shell/quickshell/Services/Brightness.qml
+++ b/accounts/gkleen@skadhi/shell/quickshell/Services/Brightness.qml
@@ -12,14 +12,15 @@ Singleton {
12 property string subsystem: "backlight" 12 property string subsystem: "backlight"
13 property string device: "amdgpu_bl1" 13 property string device: "amdgpu_bl1"
14 14
15 property real deadzone: 5268
15 property real currBrightness 16 property real currBrightness
16 property real exponent: 4 17 property real exponent: 4
17 18
18 function calcCurrBrightness() { 19 function calcCurrBrightness() {
19 if (!currFile.loaded || !maxFile.loaded) 20 if (!currFile.loaded || !maxFile.loaded)
20 return undefined; 21 return undefined;
21 const curr = Number(currFile.text()); 22 const curr = Number(currFile.text()) - deadzone;
22 const max = Number(maxFile.text()); 23 const max = Number(maxFile.text()) - deadzone;
23 const val = Math.pow(curr / max, 1 / root.exponent); 24 const val = Math.pow(curr / max, 1 / root.exponent);
24 return val; 25 return val;
25 } 26 }
@@ -56,7 +57,7 @@ Singleton {
56 else if (Math.round(curr) == actual && curr > actual) 57 else if (Math.round(curr) == actual && curr > actual)
57 curr = Math.min(max, actual + 1); 58 curr = Math.min(max, actual + 1);
58 // root.currBrightness = Math.pow(curr / max, 1 / root.exponent); 59 // root.currBrightness = Math.pow(curr / max, 1 / root.exponent);
59 Custom.Systemd.setBrightness(root.subsystem, root.device, Math.round(curr)); 60 Custom.Systemd.setBrightness(root.subsystem, root.device, Math.round(curr) + deadzone);
60 } 61 }
61 62
62 FileView { 63 FileView {