我正在尝试将我的安卓手机用作 Ubuntu 的第二台显示器。我正在关注这博客。
20-virtual.conf
这是/usr/share/X11/xorg.conf.d
Section "Device"
Identifier "intelgpu0"
Driver "intel"
Option "VirtualHeads" "1"
EndSection
这是虚拟桌面和 VNC 服务器的脚本
#!/bin/bash
W=798 # Virtual display width
H=393 # Virtual display height
O=VIRTUAL1 # The name of the virtual display (check using xrandr)
P=eDP1 # The name of your physical display (check using xrandr)
PW=$(xrandr --current | grep \* | awk '{print $1;}' | cut -d x -f 1)
# Create the virtual display
gtf $W $H 60 | sed '3q;d' | sed 's/Modeline//g' | xargs xrandr --newmode
gtf $W $H 60 | sed '3q;d' | sed 's/Modeline//g' | awk '{print $1;}' | sed 's/^.\(.*\).$/\1/' | xargs xrandr --addmode $O
gtf $W $H 60 | sed '3q;d' | sed 's/Modeline//g' | awk '{print $1;}' | sed 's/^.\(.*\).$/\1/' | xargs xrandr --output $O --right-of $P --mode
# Forward the VNC port to your device and start a VNC session
adb reverse tcp:5900 tcp:5900
x11vnc -localhost -clip ${W}x${H}+${PW}+0
# When the session ends, turn off the virtual display
xrandr --output $O --off
运行脚本后的桌面图像
有时系统会冻结,只有鼠标可以工作(然后我必须重新启动系统或重新启动 gdm)
答案1
在文件中将/usr/share/X11/xorg.conf.d/20-virtual.conf
驱动程序更改为"modesetting"
20-virtual.conf
您的文件应如下所示
Section "Device"
Identifier "intelgpu0"
Driver "modesetting"
Option "VirtualHeads" "1"
Option "TearFree" "true"
EndSection