cinnamon-monitors

This commit is contained in:
Sam 2024-05-31 15:48:46 +01:00
parent 39d407d236
commit d14e0e34a3
5 changed files with 63 additions and 6 deletions

View File

@ -0,0 +1,29 @@
{ pkgs, ... }: {
home.file.".config/cinnamon-monitors".text = ''
<monitors version="2">
<configuration>
${builtins.concatStringsSep "\n" (map (monitor: ''
<logicalmonitor>
<x>${toString monitor.x}</x>
<y>${toString monitor.y}</y>
<scale>${toString monitor.scale}</scale>
${if monitor.primary then "<primary>yes</primary>" else ""}
<monitor>
<monitorspec>
<connector>${toString monitor.name}</connector>
<vendor>${toString monitor.vendor}</vendor>
<product>${toString monitor.product}</product>
<serial>${toString monitor.serial}</serial>
</monitorspec>
<mode>
<width>${toString monitor.width}</width>
<height>${toString monitor.height}</height>
<rate>${toString monitor.refreshRate}</rate>
</mode>
</monitor>
</logicalmonitor>
''))}
</configuration>
</monitors>
'';
}

View File

@ -1 +1,6 @@
{imports = [../common];} {
imports = [
../common
./cinnamon-monitors.nix
];
}

View File

@ -18,14 +18,26 @@
]; ];
monitors = [ monitors = [
{
name = "HDMI-0";
width = 2560;
height = 1440;
vendor = "SAM";
product = "SAMSUNG";
serial = "0x01000e00";
refreshRate = 60;
x = 0;
primary = true;
}
{ {
name = "HDMI-1"; name = "HDMI-1";
width = 2560; width = 2560;
height = 1440; height = 1440;
refreshRate = 59.95; vendor = "ACI";
x = 0; product = "ASUS PB277";
workspace = "1"; serial = "0x0002507d";
primary = true; refreshRate = 75;
x = 2560;
} }
]; ];
} }

View File

@ -40,7 +40,6 @@ in
".local" ".local"
]; ];
files = [ files = [
".config/cinnamon-monitors.xml"
]; ];
}; };
}; };

View File

@ -42,6 +42,18 @@ in {
type = types.int; type = types.int;
default = 1; default = 1;
}; };
vendor = mkOption {
type = types.str;
default = "";
};
product = mkOption {
type = types.str;
default = "";
};
serial = mkOption {
type = types.str;
default = "";
};
enabled = mkOption { enabled = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;