Skip to content

Commit 5e69649

Browse files
committed
fix(brightness): cap panel backlight at 98%
Above ~64530/65535 the firmware brightness curve overflows and blanks the backlight, so setting 100% went dark. Assisted-by: AI
1 parent 27af21b commit 5e69649

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

quickshell/ii/services/Brightness.qml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ Singleton {
160160
const rawValueRounded = Math.max(Math.floor(brightnessValue * monitor.rawMaxBrightness), 1);
161161
setProc.exec(["ddcutil", "-b", busNum, "setvcp", "10", rawValueRounded]);
162162
} else {
163-
const valuePercentNumber = Math.floor(brightnessValue * 100);
163+
// Cap at 98%: on panels where amdgpu applies a firmware brightness curve, raw
164+
// values above ~64530/65535 overflow the curve and blank the backlight entirely.
165+
const valuePercentNumber = Math.min(Math.floor(brightnessValue * 100), 98);
164166
let valuePercent = `${valuePercentNumber}%`;
165167
if (valuePercentNumber == 0) valuePercent = "1"; // Prevent fully black
166168
setProc.exec(["brightnessctl", "--class", "backlight", "s", valuePercent, "--quiet"])

0 commit comments

Comments
 (0)