mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
vanadium: refactor autorandr config
This commit is contained in:
parent
6dac446be8
commit
bab392f4e1
1 changed files with 20 additions and 18 deletions
|
|
@ -48,21 +48,23 @@
|
|||
# It allows setting the name of the attribute.
|
||||
genAttrs' = xs: func: builtins.listToAttrs (map func xs);
|
||||
|
||||
mkDpiSwitch = {dpi}: {
|
||||
"10_xrdb-dpi" = "xrdb -merge ${pkgs.writeText "xrdb-dpi-config" ''
|
||||
Xcursor.size: 64
|
||||
Xft.dpi: ${toString dpi}
|
||||
''}";
|
||||
};
|
||||
switches = {
|
||||
setDPI = {dpi}: {
|
||||
"10_xrdb-dpi" = "xrdb -merge ${pkgs.writeText "xrdb-dpi-config" ''
|
||||
Xcursor.size: 64
|
||||
Xft.dpi: ${toString dpi}
|
||||
''}";
|
||||
};
|
||||
|
||||
# Is scoped to an output device, no need to be called on built-in display
|
||||
mkBrightnessSwitch = {
|
||||
device,
|
||||
brightness,
|
||||
}: {
|
||||
"10_xrandr_brightness" = ''
|
||||
xrandr --output ${device} --brightness ${toString brightness}
|
||||
'';
|
||||
# Is scoped to an output device, no need to be called on built-in display
|
||||
setSoftwareBrightness = {
|
||||
device,
|
||||
brightness,
|
||||
}: {
|
||||
"10_xrandr_brightness" = ''
|
||||
xrandr --output ${device} --brightness ${toString brightness}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
# Note: the "position" field corresponds to the "pos" field outputted by autorandr
|
||||
|
|
@ -93,7 +95,7 @@
|
|||
frameworkBuiltin = {
|
||||
fingerprint.eDP-1 = built-in;
|
||||
config = with configs; allOff // enableBuiltin;
|
||||
hooks.postswitch = mkDpiSwitch {dpi = 150;};
|
||||
hooks.postswitch = with switches; setDPI {dpi = 150;};
|
||||
};
|
||||
|
||||
mkAsusProfile = name: {
|
||||
|
|
@ -102,9 +104,9 @@
|
|||
eDP-1 = built-in;
|
||||
};
|
||||
config = with configs; allOff // enableDevice name;
|
||||
hooks.postswitch =
|
||||
mkDpiSwitch {dpi = 110;}
|
||||
// mkBrightnessSwitch {
|
||||
hooks.postswitch = with switches;
|
||||
setDPI {dpi = 110;}
|
||||
// setSoftwareBrightness {
|
||||
device = name;
|
||||
brightness = 0.7; # just a random sensible choice
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue