vanadium/autorandr: set contrast for external display

This commit is contained in:
Primrose 2025-09-19 20:40:35 +08:00
parent c93d7379ae
commit 75574d285f
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -75,7 +75,15 @@
brightness, # [0..1] brightness, # [0..1]
}: }:
singleton "10_ddc_brightness" '' singleton "10_ddc_brightness" ''
ddcutil --model ${modelName} setvcp 10 ${toString (brightness * 100)} ddcutil --model ${modelName} setvcp 10 ${toString (builtins.floor (brightness * 100))}
'';
setDDCContrast = {
modelName, # obtain with `ddcutil detect`
contrast, # [0..1]
}:
singleton "10_ddc_contrast" ''
ddcutil --model ${modelName} setvcp 12 ${toString (builtins.floor (contrast * 100))}
''; '';
}; };
@ -115,13 +123,17 @@
config = configs.allOff // configs.enableDevice name; config = configs.allOff // configs.enableDevice name;
hooks.postswitch = hooks.postswitch =
switches.setDPI {dpi = 110;} switches.setDPI {dpi = 110;}
// switches.setSoftwareBrightness {
device = name;
brightness = 1;
}
// switches.setDDCBrightness { // switches.setDDCBrightness {
modelName = "VG27AQL3A"; modelName = "VG27AQL3A";
brightness = 0; brightness = 0;
} }
// switches.setSoftwareBrightness { // switches.setDDCContrast {
device = name; modelName = "VG27AQL3A";
brightness = 1; contrast = 0.5;
}; };
}; };
in in