2020-05-26 14:19:13 +02:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
config = {
|
|
|
|
programs.autorandr = {
|
|
|
|
enable = true;
|
|
|
|
profiles = {
|
|
|
|
default = {
|
|
|
|
fingerprint = {
|
|
|
|
DP1 = "XXX";
|
|
|
|
DP2 = "YYY";
|
|
|
|
};
|
|
|
|
config = {
|
|
|
|
DP1.enable = false;
|
|
|
|
DP2 = {
|
2020-05-29 12:56:14 +02:00
|
|
|
crtc = 0;
|
2020-05-26 14:19:13 +02:00
|
|
|
primary = true;
|
|
|
|
position = "0x0";
|
|
|
|
mode = "1920x1080";
|
2022-03-17 13:45:04 +01:00
|
|
|
filter = "nearest";
|
2020-05-26 14:19:13 +02:00
|
|
|
transform = [
|
|
|
|
[ 0.6 0.0 0.0 ] # a b c
|
|
|
|
[ 0.0 0.6 0.0 ] # d e f
|
|
|
|
[ 0.0 0.0 1.0 ] # g h i
|
|
|
|
];
|
2024-09-13 09:58:00 +02:00
|
|
|
extraConfig = ''
|
|
|
|
key1 value1
|
|
|
|
key2 value2
|
|
|
|
'';
|
2020-05-26 14:19:13 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-09-26 11:08:45 +02:00
|
|
|
test.stubs.autorandr = { };
|
|
|
|
|
2020-05-26 14:19:13 +02:00
|
|
|
nmt.script = ''
|
|
|
|
config=home-files/.config/autorandr/default/config
|
|
|
|
setup=home-files/.config/autorandr/default/setup
|
|
|
|
|
|
|
|
assertFileExists $setup
|
|
|
|
assertFileRegex $setup 'DP1 XXX'
|
|
|
|
assertFileRegex $setup 'DP2 YYY'
|
|
|
|
|
|
|
|
assertFileExists $config
|
|
|
|
assertFileContent $config \
|
2021-02-07 21:52:16 +01:00
|
|
|
${
|
|
|
|
pkgs.writeText "basic-configuration.conf" ''
|
|
|
|
output DP1
|
|
|
|
off
|
|
|
|
|
|
|
|
output DP2
|
|
|
|
pos 0x0
|
|
|
|
crtc 0
|
|
|
|
primary
|
|
|
|
mode 1920x1080
|
2022-03-17 13:45:04 +01:00
|
|
|
filter nearest
|
2024-09-13 09:58:00 +02:00
|
|
|
transform 0.600000,0.000000,0.000000,0.000000,0.600000,0.000000,0.000000,0.000000,1.000000
|
|
|
|
key1 value1
|
|
|
|
key2 value2
|
|
|
|
''
|
2021-02-07 21:52:16 +01:00
|
|
|
}
|
2020-05-26 14:19:13 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|