Ubuntu+Nvidia下多显示器设定

Ubuntu+Nvidia下多显示器设定

[TOC]

目的

新显示器到了,打算一个横屏一个竖屏,Win10下的设定不用说.Ubuntu下的设定需要稍花功夫.

设置

  1. xrandr软件
    可以通过命令行的形式配置显示器.当然也可以使用Ubuntu系统更改的GUI来配置.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    xrandr
    Screen 0: minimum 8 x 8, current 7200 x 2160, maximum 32767 x 32767
    DP-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm
    1920x1080 60.00*+ 164.85 143.99 119.98 100.00 59.94
    1280x1024 75.02 60.02
    1280x720 59.94
    1024x768 119.99 99.97 75.03 70.07 60.00
    800x600 119.97 99.66 75.00 72.19 60.32 56.25
    720x480 59.94
    640x480 119.52 99.77 75.00 72.81 59.94 59.93
    DP-1 disconnected (normal left inverted right x axis y axis)
    HDMI-0 connected 1440x900+5760+0 (normal left inverted right x axis y axis) 430mm x 280mm
    ...
    DP-2 disconnected (normal left inverted right x axis y axis)
    DP-3 disconnected (normal left inverted right x axis y axis)
    DP-4 connected 3840x2160+1920+0 (normal left inverted right x axis y axis) 597mm x 336mm
    ...

    显示有三块显示器,分别是DP-0,HDMI-0,DP-4.

    1
    2
    3
    4
    5
    xrandr --output DP-4 --auto --primary #设置主屏
    xrandr --output DP-4 --scale 0.8x0.8 #4k屏显示扩大
    xrandr --output HDMI-0 --right-of DP-4 --auto #设置右屏
    xrandr --output DP-0 --left-of DP-4 --auto #设置左屏
    xrandr --output DP-0 --rotate left #旋转成竖屏

问题

出现的问题是竖屏里无法拖入主屏幕来的窗口,本身也无法显示任何窗口.

解决办法

打开Nvidia的 X server setting,在X Server Display Configuration选项卡里的layout处,把左侧垂直的屏幕拉贴到主屏幕,apply后正常.
monitor_setting

作者

cx

发布于

2021-07-31

更新于

2022-07-16

许可协议