forked from Shinonome/dots-hyprland
Brightness fix for multiple devices (#2415)
This commit is contained in:
@@ -135,10 +135,20 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function syncBrightness() {
|
function syncBrightness() {
|
||||||
const brightnessValue = Math.max(monitor.multipliedBrightness, 0)
|
const brightnessValue = Math.max(monitor.multipliedBrightness, 0);
|
||||||
const rawValueRounded = Math.max(Math.floor(brightnessValue * monitor.rawMaxBrightness), 1);
|
if(isDdc){
|
||||||
setProc.command = isDdc ? ["ddcutil", "-b", busNum, "setvcp", "10", rawValueRounded] : ["brightnessctl", "--class", "backlight", "s", rawValueRounded, "--quiet"];
|
const rawValueRounded = Math.max(Math.floor(brightnessValue * monitor.rawMaxBrightness), 1);
|
||||||
setProc.startDetached();
|
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 {
|
function setBrightness(value: real): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user