porcorosso: tweak setup-display so that it overrides panning

This commit is contained in:
Luke Granger-Brown 2022-01-08 22:17:13 +00:00
parent 9472db4577
commit 2770e7c086
2 changed files with 27 additions and 10 deletions

View file

@ -15,6 +15,12 @@ let
(nvidia-offload-profile + '' (nvidia-offload-profile + ''
exec -a "$0" "$@" exec -a "$0" "$@"
''); '');
setup-display = pkgs.writeShellScriptBin "setup-display-porcorosso" ''
${pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource modesetting NVIDIA-0
${pkgs.xorg.xrandr}/bin/xrandr --auto
${pkgs.autorandr}/bin/autorandr -c
'';
in { in {
imports = [ imports = [
../lib/zfs.nix ../lib/zfs.nix
@ -188,14 +194,8 @@ in {
extraGroups = [ "wheel" "networkmanager" "libvirtd" "lxd" "video" ]; extraGroups = [ "wheel" "networkmanager" "libvirtd" "lxd" "video" ];
}; };
my.home-manager.system = {...}: { my.home-manager.system = {...}: {
xsession.windowManager.i3.config.startup = let xsession.windowManager.i3.config.startup = lib.mkAfter [
setupDisplay = pkgs.writeShellScriptBin "setup-display-porcorosso" '' { command = "${setup-display}/bin/setup-display-porcorosso"; notification = false; }
${pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource modesetting NVIDIA-0
${pkgs.xorg.xrandr}/bin/xrandr --auto
${pkgs.autorandr}/bin/autorandr -c
'';
in lib.mkAfter [
{ command = "${setupDisplay}/bin/setup-display-porcorosso"; notification = false; }
]; ];
programs.autorandr = { programs.autorandr = {
enable = true; enable = true;
@ -206,21 +206,29 @@ in {
mode = "1920x1080"; mode = "1920x1080";
position = "0x0"; position = "0x0";
rate = "59.98"; rate = "59.98";
transform = [
[ 2.0 0.0 0.0 ]
[ 0.0 2.0 0.0 ]
[ 0.0 0.0 1.0 ]
];
panning = "3840x2160+0+0";
crtc = 4; crtc = 4;
}; };
"DP-0.2" = { "DP-0.2" = {
enable = true; enable = true;
mode = "3840x2160"; mode = "3840x2160";
primary = true; primary = true;
position = "1920x0"; position = "3840x0";
rate = "60.00"; rate = "60.00";
panning = "3840x2160+3840+0";
crtc = 1; crtc = 1;
}; };
"DP-0.1" = { "DP-0.1" = {
enable = true; enable = true;
mode = "3840x2160"; mode = "3840x2160";
position = "5760x0"; position = "7680x0";
rate = "60.00"; rate = "60.00";
panning = "3840x2160+7680+0";
crtc = 0; crtc = 0;
}; };
}; };
@ -251,6 +259,7 @@ in {
iw iw
obs-studio obs-studio
vulkan-tools vulkan-tools
setup-display
]); ]);
}; };

View file

@ -89,6 +89,13 @@ let
example = "60.00"; example = "60.00";
}; };
panning = mkOption {
type = types.str;
description = "X11 panning specification ([width]x[height]+[x]+[y]).";
default = "";
example = "3840x2160+0+0";
};
gamma = mkOption { gamma = mkOption {
type = types.str; type = types.str;
description = "Output gamma configuration."; description = "Output gamma configuration.";
@ -259,6 +266,7 @@ let
++ optional (config.dpi != null) "dpi ${toString config.dpi}" ++ optional (config.dpi != null) "dpi ${toString config.dpi}"
++ optional (config.gamma != "") "gamma ${config.gamma}" ++ optional (config.gamma != "") "gamma ${config.gamma}"
++ optional (config.mode != "") "mode ${config.mode}" ++ optional (config.mode != "") "mode ${config.mode}"
++ optional (config.panning != "") "panning ${config.panning}"
++ optional (config.rate != "") "rate ${config.rate}" ++ optional (config.rate != "") "rate ${config.rate}"
++ optional (config.rotate != null) "rotate ${config.rotate}" ++ optional (config.rotate != null) "rotate ${config.rotate}"
++ optional (config.transform != null) ("transform " ++ optional (config.transform != null) ("transform "