summaryrefslogtreecommitdiff
path: root/accounts/gkleen@skadhi/shell/quickshell
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2026-09-24 11:27:23 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2026-09-24 11:27:23 +0200
commit56a38bc2821e2a00efd75274ad080cde5614f7ce (patch)
treec932dcd9a54ab2f872e0f17647f5187a61d59ce3 /accounts/gkleen@skadhi/shell/quickshell
parent8f6f80f98eca42c980861beb4e008a2e64416c65 (diff)
downloadnixos-56a38bc2821e2a00efd75274ad080cde5614f7ce.tar
nixos-56a38bc2821e2a00efd75274ad080cde5614f7ce.tar.gz
nixos-56a38bc2821e2a00efd75274ad080cde5614f7ce.tar.bz2
nixos-56a38bc2821e2a00efd75274ad080cde5614f7ce.tar.xz
nixos-56a38bc2821e2a00efd75274ad080cde5614f7ce.zip
...
Diffstat (limited to 'accounts/gkleen@skadhi/shell/quickshell')
-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 {