mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49: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);
|
genAttrs' = xs: func: builtins.listToAttrs (map func xs);
|
||||||
|
|
||||||
mkExtSwitch = {dpi}: {
|
mkDpiSwitch = {dpi}: {
|
||||||
"10_xrdb-dpi" = "xrdb -merge ${pkgs.writeText "xrdb-dpi-config" ''
|
"10_xrdb-dpi" = "xrdb -merge ${pkgs.writeText "xrdb-dpi-config" ''
|
||||||
Xcursor.size: 64
|
Xcursor.size: 64
|
||||||
Xft.dpi: ${toString dpi}
|
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
|
# Note: the "position" field corresponds to the "pos" field outputted by autorandr
|
||||||
# To get the current config, run `xrandr --auto` and then `autorandr --config`
|
# To get the current config, run `xrandr --auto` and then `autorandr --config`
|
||||||
configs = {
|
configs = {
|
||||||
|
|
@ -89,7 +98,7 @@
|
||||||
fingerprint.eDP-1 = built-in;
|
fingerprint.eDP-1 = built-in;
|
||||||
config = with configs;
|
config = with configs;
|
||||||
allOff // enableBuiltin;
|
allOff // enableBuiltin;
|
||||||
hooks.postswitch = mkExtSwitch {dpi = 150;};
|
hooks.postswitch = mkDpiSwitch {dpi = 150;};
|
||||||
};
|
};
|
||||||
|
|
||||||
mkAsusProfile = name: {
|
mkAsusProfile = name: {
|
||||||
|
|
@ -99,7 +108,12 @@
|
||||||
};
|
};
|
||||||
config = with configs;
|
config = with configs;
|
||||||
allOff // enableDevice name;
|
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
|
in
|
||||||
{default = frameworkBuiltin;}
|
{default = frameworkBuiltin;}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue