vanadium: set ext display "default" software brightness

This commit is contained in:
Primrose 2025-09-02 18:23:27 +08:00
parent e283f81f81
commit a6be9276c0
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -50,13 +50,22 @@
*/
genAttrs' = xs: func: builtins.listToAttrs (map func xs);
mkExtSwitch = {dpi}: {
mkDpiSwitch = {dpi}: {
"10_xrdb-dpi" = "xrdb -merge ${pkgs.writeText "xrdb-dpi-config" ''
Xcursor.size: 64
Xft.dpi: ${toString dpi}
''}";
};
mkBrightnessSwitch = {
device,
brightness,
}: {
"10_xrandr_brightness" = ''
xrandr --output ${device} --brightness ${toString brightness}
'';
};
# Note: the "position" field corresponds to the "pos" field outputted by autorandr
# To get the current config, run `xrandr --auto` and then `autorandr --config`
configs = {
@ -89,7 +98,7 @@
fingerprint.eDP-1 = built-in;
config = with configs;
allOff // enableBuiltin;
hooks.postswitch = mkExtSwitch {dpi = 150;};
hooks.postswitch = mkDpiSwitch {dpi = 150;};
};
mkAsusProfile = name: {
@ -99,7 +108,12 @@
};
config = with configs;
allOff // enableDevice name;
hooks.postswitch = mkExtSwitch {dpi = 110;};
hooks.postswitch =
mkDpiSwitch {dpi = 110;}
// mkBrightnessSwitch {
device = name;
brightness = 0.7; # just a random sensible choice
};
};
in
{default = frameworkBuiltin;}