我使用的是3台显示器,其中2台是旋转的。
我无法成功地将xorg.conf配置为旋转2监视器,但在启动登录管理器之后,我找到了一个xrandr命令:
xrandr --output DisplayPort-1 --rotate right --left-of DisplayPort-0
xrandr --output DisplayPort-2 --rotate left --right-of DisplayPort-0目前,我正在手动运行这些命令登录后。
我应该把这些放在哪里,以便我的显示器在登录时旋转。还有,我可以在全球范围内做吗?这样,当我作为其他用户登录时,监视器就会被旋转。或者每个用户在登录后都需要一个用户脚本来完成这个任务?
发布于 2020-01-02 11:16:10
我使用的是两个屏幕布局,有点类似你的,我的是一个正常的屏幕在右边和肖像导向的一个在左边。与我的设置,我有X完美地工作在我的2个屏幕。
这是我为您自己的情况提出的建议(很难测试,因为我没有相同的屏幕,也没有3个屏幕),但这应该足以让您获得一个工作的X设置。
将以下文件放入/etc/X11/xorg.conf.d/
30-screen-dport0.conf
30-screen-dport1.conf
30-screen-dport2.conf有以下内容:
Section "Monitor"
Identifier "DisplayPort-0"
Option "Primary" "true"
Option "PreferredMode" "3840x2160" # Adapt this if you resolution is not the same
Option "Position" "1200 0"
EndSection
Section "Screen"
Identifier "DPC"
Device "nVidia" # here you choose your driver
Monitor "DisplayPort-0"
EndSectionSection "Monitor"
Identifier "DisplayPort-1 "
Option "LeftOf" "DisplayPort-0"
Option "Rotate" "left"
Option "PreferredMode" "1920x1200"
Option "Position" "0 0"
EndSection
Section "Screen"
Identifier "DPL"
Device "nVidia"
Monitor "DisplayPort-1"
EndSectionSection "Monitor"
Identifier "DisplayPort-2"
Option "RightOf" "DisplayPort-0"
Option "Rotate" "right"
Option "PreferredMode" "1920x1200"
Option "Position" "5040 0" # 1200 + 3840
EndSection
Section "Screen"
Identifier "DPR"
Device "nVidia"
Monitor "DisplayPort-2"
EndSectionSection "ServerLayout"
Identifier "Main"
Screen 0 "DPL"
Screen 1 "DPC"
Screen 2 "DPR
EndSectionXserver的坐标以下列方式工作
0 X
+ -----------------> X-axis
|0
|
|
|
|
|
| Y
V Y-axis nVidia标识符是对在文件中定义的视频卡的引用。
Section "Device"
Identifier "nVidia"
Driver "nouveau"
Option "AccelMethod" "sna"
Option "GLXVBlank" "true"
# Need to flag this as only referring to one output on the card
Screen 0
EndSection发布于 2020-01-01 19:58:14
我使用用户土地系统服务(full path = $HOME/.config/systemd/user/set-display.service)在我的QEMU上处理类似的情况,这些VM使用XFCE,并且不会自动填充屏幕(由于conky而被切断):
[Unit]
Description=Set Display Resolution
[Service]
ExecStartPre=/bin/sleep 5
Type=oneshot
ExecStart=/usr/bin/xrandr --output Virtual-0 --mode 1499x996
[Install]
WantedBy=default.target我使用睡眠命令来确保DE是完全加载的;我在SSD上的VM总是在5秒或更短的时间内很好,有时HDD还需要更多。只需创建一个脚本,运行您的xrandr命令,在ExecStart=上替换它(类似于ExecStart=/path/to/your/script),然后启用它(systemctl --user enable set-display)。
更新: Debian上的系统服务测试不起作用,即使在登录后手动运行服务(尝试作为root用户和普通用户)。
发布于 2020-01-07 00:06:09
从命令行(如果您正在使用nano替换为vim)
sudo nano /etc/xdg/autostart/rotate-screen-1.desktop然后粘贴以下内容并保存:
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Name=Xrandr Screen 1 Rotation
Icon=preferences-desktop-screensaver
Exec=xrandr --output DisplayPort-1 --rotate right --left-of DisplayPort-0
Terminal=false
OnlyShowIn=LXDE;OPENBOX;GNOME;KDE;
Categories=System;Security;Utility;
StartupNotify=false
X-KDE-autostart-after=panel
X-OPENBOX-Autostart-enabled=true那么第二个屏幕也是一样的。
sudo nano /etc/xdg/autostart/rotate-screen-2.desktop然后粘贴以下内容并保存:
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Name=Xrandr Screen 2 Rotation
Icon=preferences-desktop-screensaver
Exec=xrandr --output DisplayPort-2 --rotate left --right-of DisplayPort-0
Terminal=false
OnlyShowIn=LXDE;OPENBOX;GNOME;KDE;
Categories=System;Security;Utility;
StartupNotify=false
X-KDE-autostart-after=panel
X-OPENBOX-Autostart-enabled=true重新启动后,屏幕应自动旋转。
https://unix.stackexchange.com/questions/559589
复制相似问题