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,7 +48,8 @@
|
||||||
# It allows setting the name of the attribute.
|
# It allows setting the name of the attribute.
|
||||||
genAttrs' = xs: func: builtins.listToAttrs (map func xs);
|
genAttrs' = xs: func: builtins.listToAttrs (map func xs);
|
||||||
|
|
||||||
mkDpiSwitch = {dpi}: {
|
switches = {
|
||||||
|
setDPI = {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}
|
||||||
|
|
@ -56,7 +57,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
# 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
|
||||||
mkBrightnessSwitch = {
|
setSoftwareBrightness = {
|
||||||
device,
|
device,
|
||||||
brightness,
|
brightness,
|
||||||
}: {
|
}: {
|
||||||
|
|
@ -64,6 +65,7 @@
|
||||||
xrandr --output ${device} --brightness ${toString 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`
|
||||||
|
|
@ -93,7 +95,7 @@
|
||||||
frameworkBuiltin = {
|
frameworkBuiltin = {
|
||||||
fingerprint.eDP-1 = built-in;
|
fingerprint.eDP-1 = built-in;
|
||||||
config = with configs; allOff // enableBuiltin;
|
config = with configs; allOff // enableBuiltin;
|
||||||
hooks.postswitch = mkDpiSwitch {dpi = 150;};
|
hooks.postswitch = with switches; setDPI {dpi = 150;};
|
||||||
};
|
};
|
||||||
|
|
||||||
mkAsusProfile = name: {
|
mkAsusProfile = name: {
|
||||||
|
|
@ -102,9 +104,9 @@
|
||||||
eDP-1 = built-in;
|
eDP-1 = built-in;
|
||||||
};
|
};
|
||||||
config = with configs; allOff // enableDevice name;
|
config = with configs; allOff // enableDevice name;
|
||||||
hooks.postswitch =
|
hooks.postswitch = with switches;
|
||||||
mkDpiSwitch {dpi = 110;}
|
setDPI {dpi = 110;}
|
||||||
// mkBrightnessSwitch {
|
// setSoftwareBrightness {
|
||||||
device = name;
|
device = name;
|
||||||
brightness = 0.7; # just a random sensible choice
|
brightness = 0.7; # just a random sensible choice
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue