vanadium/autorandr: reference programs directly in hooks

This commit is contained in:
Primrose 2025-10-21 21:48:42 +08:00
parent 1635fdc3a3
commit 0d55754272
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -51,7 +51,7 @@
switches = { switches = {
setDPI = {dpi}: setDPI = {dpi}:
singleton "10_xrdb-dpi" "xrdb -merge ${pkgs.writeText "xrdb-dpi-config" '' singleton "10_xrdb-dpi" "${lib.getExe pkgs.xorg.xrdb} -merge ${pkgs.writeText "xrdb-dpi-config" ''
Xcursor.size: 64 Xcursor.size: 64
Xft.dpi: ${toString dpi} Xft.dpi: ${toString dpi}
''}"; ''}";
@ -66,7 +66,7 @@
# For that reason, we can't base our delay on its output, sadly. # For that reason, we can't base our delay on its output, sadly.
singleton "10_xrandr_brightness" '' singleton "10_xrandr_brightness" ''
sleep 10 sleep 10
xrandr --output ${device} --brightness ${toString brightness} ${lib.getExe pkgs.xorg.xrandr} --output ${device} --brightness ${toString brightness}
''; '';
# Is scoped to an output device, no need to be called on built-in display # Is scoped to an output device, no need to be called on built-in display
@ -75,7 +75,7 @@
brightness, # [0..1] brightness, # [0..1]
}: }:
singleton "10_ddc_brightness" '' singleton "10_ddc_brightness" ''
ddcutil --model ${modelName} setvcp 10 ${toString (builtins.floor (brightness * 100))} ${lib.getExe pkgs.ddcutil} --model ${modelName} setvcp 10 ${toString (builtins.floor (brightness * 100))}
''; '';
setDDCContrast = { setDDCContrast = {
@ -83,7 +83,7 @@
contrast, # [0..1] contrast, # [0..1]
}: }:
singleton "10_ddc_contrast" '' singleton "10_ddc_contrast" ''
ddcutil --model ${modelName} setvcp 12 ${toString (builtins.floor (contrast * 100))} ${lib.getExe pkgs.ddcutil} --model ${modelName} setvcp 12 ${toString (builtins.floor (contrast * 100))}
''; '';
}; };