顺时针旋转屏幕 90 度

顺时针旋转屏幕 90 度

刚买了一台装有 NVidia GForce N430 的新电脑,并安装了全新的 Ubuntu 11.10 amd64。

我还使用“附加驱动程序”apt 启用了 nvidia 驱动程序,并且在“正常”模式下一切运行正常,但是,我想旋转屏幕,却无法实现。

据我回忆,在以前的安装中,UI 中曾经有一个用于旋转的条目nvidia-settings,但在这个版本中没有。

我正在使用两个屏幕,并愿意将它们顺时针旋转 90 度(纵向与横向)使用。

我正在转储我的 X11/xorg.cong 文件,如果有人能告诉我在哪里添加该Option "RandRRotation" "True"行,我将不胜感激。

顺便一提,

$ xrandr -o right

打印出来

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  153 (RANDR)
  Minor opcode of failed request:  2 (RRSetScreenConfig)
  Serial number of failed request:  14
  Current serial number in output stream:  14

/etc/X11/xorg.conf 的内容

$ cat /etc/X11/xorg.conf

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 280.13  (buildd@allspice)  Thu Aug 11 20:54:45 UTC 2011


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"

    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "Philips 225P"
    HorizSync       30.0 - 83.0
    VertRefresh     56.0 - 76.0
    Option         "DPMS"
EndSection

Section "Monitor"

    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Philips 225P"
    HorizSync       30.0 - 83.0
    VertRefresh     56.0 - 76.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 430"
    BusID          "PCI:4:0:0"
    Screen          1
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 430"
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "DFP-1: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"

# Removed Option "TwinView" "0"
# Removed Option "metamodes" "DFP-0: nvidia-auto-select +0+0"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "1"
    Option         "metamodes" "DFP-0: nvidia-auto-select +1680+0, DFP-1: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

答案1

您需要在 xorg.conf 文件中驱动程序列为“nvidia”的设备部分后面添加以下行

Option "RandRRotation" "on"

例子:

Section "Device"
    Identifier  "Default Device"
    Driver  "nvidia"
    Option  "RandRRotation" "on"
EndSection

保存文件然后注销并重新登录以重新启动 Xserver。

使用以下 xrandr 命令旋转屏幕;

xrandr -o left向左旋转、 xrandr -o right向右旋转、 xrandr -o normal返回正常屏幕、 xrandr -o inverted将屏幕翻转。

参考

答案2

我在 Gist 上创建了一个适用于 Lenovo Yoga 2 的脚本,因此您必须调整标识符字符串:

旋转屏幕.sh(在 gist.github.com 上)

相关内容