mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
vanadium: set ext display "default" software brightness
This commit is contained in:
parent
e283f81f81
commit
a6be9276c0
1 changed files with 17 additions and 3 deletions
|
|
@ -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;}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue