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 + ''
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 {
imports = [
../lib/zfs.nix
@ -188,14 +194,8 @@ in {
extraGroups = [ "wheel" "networkmanager" "libvirtd" "lxd" "video" ];
};
my.home-manager.system = {...}: {
xsession.windowManager.i3.config.startup = let
setupDisplay = 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 lib.mkAfter [
{ command = "${setupDisplay}/bin/setup-display-porcorosso"; notification = false; }
xsession.windowManager.i3.config.startup = lib.mkAfter [
{ command = "${setup-display}/bin/setup-display-porcorosso"; notification = false; }
];
programs.autorandr = {
enable = true;
@ -206,21 +206,29 @@ in {
mode = "1920x1080";
position = "0x0";
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;
};
"DP-0.2" = {
enable = true;
mode = "3840x2160";
primary = true;
position = "1920x0";
position = "3840x0";
rate = "60.00";
panning = "3840x2160+3840+0";
crtc = 1;
};
"DP-0.1" = {
enable = true;
mode = "3840x2160";
position = "5760x0";
position = "7680x0";
rate = "60.00";
panning = "3840x2160+7680+0";
crtc = 0;
};
};
@ -251,6 +259,7 @@ in {
iw
obs-studio
vulkan-tools
setup-display
]);
};

View file

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