services: add brightnessIncrement config property (#1010)

* feat: Add brightnessIncrement config property

* birghtness increment applies on bar scroll
This commit is contained in:
Ezekiel Gonzales 2026-01-03 16:04:00 +08:00 committed by GitHub
parent 04bfc87f65
commit 49b94e7b18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 4 deletions

View file

@ -563,6 +563,7 @@ default, you must create it manually.
}, },
"services": { "services": {
"audioIncrement": 0.1, "audioIncrement": 0.1,
"brightnessIncrement": 0.1,
"maxVolume": 1.0, "maxVolume": 1.0,
"defaultPlayer": "Spotify", "defaultPlayer": "Spotify",
"gpuType": "", "gpuType": "",

View file

@ -8,6 +8,7 @@ JsonObject {
property string gpuType: "" property string gpuType: ""
property int visualiserBars: 45 property int visualiserBars: 45
property real audioIncrement: 0.1 property real audioIncrement: 0.1
property real brightnessIncrement: 0.1
property real maxVolume: 1.0 property real maxVolume: 1.0
property bool smartScheme: true property bool smartScheme: true
property string defaultPlayer: "Spotify" property string defaultPlayer: "Spotify"

View file

@ -95,9 +95,9 @@ ColumnLayout {
// Brightness scroll on bottom half // Brightness scroll on bottom half
const monitor = Brightness.getMonitorForScreen(screen); const monitor = Brightness.getMonitorForScreen(screen);
if (angleDelta.y > 0) if (angleDelta.y > 0)
monitor.setBrightness(monitor.brightness + 0.1); monitor.setBrightness(monitor.brightness + Config.services.brightnessIncrement);
else if (angleDelta.y < 0) else if (angleDelta.y < 0)
monitor.setBrightness(monitor.brightness - 0.1); monitor.setBrightness(monitor.brightness - Config.services.brightnessIncrement);
} }
} }

View file

@ -1,6 +1,7 @@
pragma Singleton pragma Singleton
pragma ComponentBehavior: Bound pragma ComponentBehavior: Bound
import qs.config
import qs.components.misc import qs.components.misc
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
@ -43,13 +44,13 @@ Singleton {
function increaseBrightness(): void { function increaseBrightness(): void {
const monitor = getMonitor("active"); const monitor = getMonitor("active");
if (monitor) if (monitor)
monitor.setBrightness(monitor.brightness + 0.1); monitor.setBrightness(monitor.brightness + Config.services.brightnessIncrement);
} }
function decreaseBrightness(): void { function decreaseBrightness(): void {
const monitor = getMonitor("active"); const monitor = getMonitor("active");
if (monitor) if (monitor)
monitor.setBrightness(monitor.brightness - 0.1); monitor.setBrightness(monitor.brightness - Config.services.brightnessIncrement);
} }
onMonitorsChanged: { onMonitorsChanged: {