change display port

This commit is contained in:
nyanloutre 2022-05-18 19:44:20 +02:00
parent 406be8c14f
commit 5b515d6147
Signed by: nyanloutre
GPG Key ID: 194A92D1103ACB2A
1 changed files with 12 additions and 13 deletions

View File

@ -209,13 +209,12 @@
};
services.xserver.deviceSection = ''
Option "metamodes" "DP-0: 3440x1440_144 +0+0 {AllowGSYNCCompatible=On}"
Option "metamodes" "DP-4: 3440x1440_144 +0+0 {AllowGSYNCCompatible=On}"
'';
systemd = let
DP0Config = "--output DP-0 --mode 3440x1440 --rate 144";
DP2Config = "--output DP-2 --auto --left-of DP-0";
HDMIConfig = "--output HDMI-0 --auto --left-of DP-0";
DP4Config = "--output DP-4 --mode 3440x1440 --rate 144";
HDMIConfig = "--output HDMI-0 --auto --left-of DP-4";
in {
services = {
wol = {
@ -235,8 +234,8 @@
"enableTV" = {
description = "Enable TV output";
script = ''
${pkgs.xorg.xrandr}/bin/xrandr ${DP0Config} --primary
/run/current-system/sw/bin/nvidia-settings --assign CurrentMetaMode="DP-0: 3440x1440_144 { AllowGSYNCCompatible=On }"
${pkgs.xorg.xrandr}/bin/xrandr ${DP4Config} --primary
/run/current-system/sw/bin/nvidia-settings --assign CurrentMetaMode="DP-4: 3440x1440_144 { AllowGSYNCCompatible=On }"
${pkgs.xorg.xrandr}/bin/xrandr ${HDMIConfig}
${pkgs.pipewire}/bin/pw-cli s 43 Profile '{ index: 1 }'
'';
@ -246,8 +245,8 @@
"primaryTV" = {
description = "Set TV output as primary";
script = ''
${pkgs.xorg.xrandr}/bin/xrandr ${DP0Config}
/run/current-system/sw/bin/nvidia-settings --assign CurrentMetaMode="DP-0: 3440x1440_144 { AllowGSYNCCompatible=On }"
${pkgs.xorg.xrandr}/bin/xrandr ${DP4Config}
/run/current-system/sw/bin/nvidia-settings --assign CurrentMetaMode="DP-4: 3440x1440_144 { AllowGSYNCCompatible=On }"
${pkgs.xorg.xrandr}/bin/xrandr ${HDMIConfig} --primary
${pkgs.pipewire}/bin/pw-cli s 43 Profile '{ index: 1 }'
'';
@ -257,8 +256,8 @@
"FreeSyncMode" = {
description = "Enable FreeSync screen only";
script = ''
${pkgs.xorg.xrandr}/bin/xrandr ${DP0Config}
/run/current-system/sw/bin/nvidia-settings --assign CurrentMetaMode="DP-0: 3440x1440_144 { AllowGSYNCCompatible=On }"
${pkgs.xorg.xrandr}/bin/xrandr ${DP4Config}
/run/current-system/sw/bin/nvidia-settings --assign CurrentMetaMode="DP-4: 3440x1440_144 { AllowGSYNCCompatible=On }"
${pkgs.xorg.xrandr}/bin/xrandr --output HDMI-0 --off
'';
conflicts = ["CSMode.service"];
@ -267,12 +266,12 @@
"CSMode" = {
description = "Enable 4:3 black bars";
script = ''
${pkgs.xorg.xrandr}/bin/xrandr ${DP0Config} --primary
/run/current-system/sw/bin/nvidia-settings --assign CurrentMetaMode="DP-0: 3440x1440_144 { ViewPortIn=3440x1440, ViewPortOut=1920x1440+760+0, AllowGSYNCCompatible=On }"
${pkgs.xorg.xrandr}/bin/xrandr ${DP4Config} --primary
/run/current-system/sw/bin/nvidia-settings --assign CurrentMetaMode="DP-4: 3440x1440_144 { ViewPortIn=3440x1440, ViewPortOut=1920x1440+760+0, AllowGSYNCCompatible=On }"
${pkgs.xorg.xrandr}/bin/xrandr --output HDMI-0 --off
'';
preStop = ''
/run/current-system/sw/bin/nvidia-settings --assign CurrentMetaMode="DP-0: 3440x1440_144 { ViewPortIn=3440x1440, ViewPortOut=3440x1440+0+0, AllowGSYNCCompatible=On }"
/run/current-system/sw/bin/nvidia-settings --assign CurrentMetaMode="DP-4: 3440x1440_144 { ViewPortIn=3440x1440, ViewPortOut=3440x1440+0+0, AllowGSYNCCompatible=On }"
'';
serviceConfig = {
Type = "oneshot";