YYTMIPI7LCD2203/UbuntuDisplay

From wiki
Jump to: navigation, search


ubuntu/Debian系统下如何设置双屏

使用xrandr

使用 xrandr 去设置双屏同显和异显功能。"xrandr" 是一款官方的 RandRWikipedia:X Window System 扩展配置工具。 它可以设置屏幕显示的大小、 方向、 镜像等。

双屏幕显示相同的内容(auto 为最高分辨率)

查看显示器信息。

打开终端,输入命令:

xrandr

设置主屏

xrandr --output HDMI-1 --auto --primary

复制屏幕

xrandr --output HDMI-1-1 --same-as eDP-1-1 --auto

右扩展屏幕(HDMI为eDP的右扩展屏)

设置双屏的位置,也就是挪动鼠标从哪个屏幕进入另一个屏幕

xrandr --output HDMI-1-1 --right-of eDP-1-1 --auto 

异显模式下支持 On right、 Above、 On left、 Below 四种模式。 其中--right-of 可以替换成 right-of,left-of, below, same-as, preferred, off 等等,从而实现不同的屏幕显示功能。

只显示副屏

xrandr --output HDMI-1-1 --auto --output eDP-1-1 --off 

xinput设置

匹配触摸输出

xinput map-to-output 9 VGA-1

在终端输入 xinput,查看触屏显示器 id,在这里 id=9 的设备是触屏。
注意:触屏的 id 可能会随着鼠标、键盘等外设的挺拔而发生变化,务必要使用 xinput 确认一下。

使用 xrandr 命令查看各显示器配置,这里 VGA-1 是触屏。