mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 14:59:27 -05:00
Brightness fix for multiple devices (#2415)
This commit is contained in:
@@ -135,10 +135,20 @@ Singleton {
|
||||
}
|
||||
|
||||
function syncBrightness() {
|
||||
const brightnessValue = Math.max(monitor.multipliedBrightness, 0)
|
||||
const rawValueRounded = Math.max(Math.floor(brightnessValue * monitor.rawMaxBrightness), 1);
|
||||
setProc.command = isDdc ? ["ddcutil", "-b", busNum, "setvcp", "10", rawValueRounded] : ["brightnessctl", "--class", "backlight", "s", rawValueRounded, "--quiet"];
|
||||
setProc.startDetached();
|
||||
const brightnessValue = Math.max(monitor.multipliedBrightness, 0);
|
||||
if(isDdc){
|
||||
const rawValueRounded = Math.max(Math.floor(brightnessValue * monitor.rawMaxBrightness), 1);
|
||||
setProc.command = ["ddcutil", "-b", busNum, "setvcp", "10", rawValueRounded];
|
||||
setProc.startDetached();
|
||||
}else{
|
||||
const valuePercentNumber = Math.floor(brightnessValue * 100);
|
||||
let valuePercent = ""+valuePercentNumber+"%";
|
||||
if(valuePercentNumber == 0)
|
||||
//Set it to raw 1
|
||||
valuePercent = 1;
|
||||
setProc.command = ["brightnessctl", "--class", "backlight", "s", valuePercent, "--quiet"];
|
||||
setProc.startDetached();
|
||||
}
|
||||
}
|
||||
|
||||
function setBrightness(value: real): void {
|
||||
|
||||
Reference in New Issue
Block a user