autorandr: add basic configuration test

This commit is contained in:
Nikita Uvarov 2020-05-26 14:19:13 +02:00 committed by Robert Helgesson
parent b95ad63201
commit 09304026ae
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
4 changed files with 58 additions and 0 deletions

View file

@ -64,6 +64,7 @@ import nmt {
./modules/misc/xdg
./modules/misc/xsession
./modules/programs/abook
./modules/programs/autorandr
./modules/programs/firefox
./modules/programs/getmail
./modules/services/lieer

View file

@ -0,0 +1,9 @@
output DP1
off
output DP2
pos 0x0
primary
mode 1920x1080
transform 0.600000,0.000000,0.000000,0.000000,0.600000,0.000000,0.000000,0.000000,1.000000
scale 2x4

View file

@ -0,0 +1,47 @@
{ config, pkgs, ... }:
{
config = {
programs.autorandr = {
enable = true;
profiles = {
default = {
fingerprint = {
DP1 = "XXX";
DP2 = "YYY";
};
config = {
DP1.enable = false;
DP2 = {
primary = true;
position = "0x0";
mode = "1920x1080";
scale = {
x = 2;
y = 4;
};
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
];
};
};
};
};
};
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 \
${./basic-configuration.conf}
'';
};
}

View file

@ -0,0 +1 @@
{ autorandr-basic-configuration = ./basic-configuration.nix; }