我的显示器部分坏了。如何使用 xrandr 或任何类似工具减少可见空间?

Mac*_*cer 7 xorg xrandr graphics monitors display

我的辅助显示器在屏幕顶部 1/3 处部分损坏,因此我想添加黑条并显示如下图所示的内容。最重要的部分是现在的一切。底部是我想要实现的。此处列出的分辨率是每个屏幕的最大值。

这是第二个屏幕的 xrandr 输出:

VGA1 connected 1920x1080+1366+12 (normal left inverted right x axis y axis) 890mm x 500mm
1920x1080     60.00*+
1600x1200     60.00  
1680x1050     59.95  
1280x1024     75.02    60.02  
1440x900      74.98    59.89  
1280x960      60.00  
1360x768      60.02  
1280x800      59.81  
1152x864      75.00  
1024x768      75.08    70.07    60.00  
832x624       74.55  
800x600       72.19    75.00    60.32  
640x480       75.00    72.81    66.67    60.00  
720x400       70.08 
Run Code Online (Sandbox Code Playgroud)

示意图

mvi*_*eck 3

可能的解决方法:

使用空面板覆盖受损区域,以利用剩余空间强制打开窗户。比如xfce4-panel可以配置好。这取决于您的桌面环境,其效果如何。我认为 Xfce 和 LXDE 可以正常工作,但 Gnome 会出现问题。这对于覆盖面板的全屏应用程序没有帮助,例如全屏的 firefox+F11 或 VLC。

全屏应用程序的解决方法:Xephyr从所需的屏幕尺寸开始,定位它并在其中启动应用程序。使用脚本和“xdotool”自动执行此操作:

Xephyr :1 -screen 1500x800x24 &
xdotool search --name Xephyr windowmove 0 437
Run Code Online (Sandbox Code Playgroud)

在 Xephyr 窗口中使用 启动应用程序DISPLAY=:1 firefox。Xephyr 不支持硬件加速,但virtualgl可以在这里提供帮助。


最佳解决方法:

weston与 一起使用Xwayland。它支持硬件加速和全屏应用程序。

使用一个相当轻量级的窗口管理器,就像openbox在启动时一样(或者更好,一个完全没有窗口装饰的窗口管理器,比如evilwm)。它仅作为背景环境,weston 将覆盖它。

创建myweston.ini一个像这样的自定义文件(请参阅man weston.ini):

[core]
shell=desktop-shell.so
idle-time=0

[shell]
panel-location=none
locking=false

[output]
name=X1
mode=1366x768

[output]
name=X2
mode=1500x768
Run Code Online (Sandbox Code Playgroud)

创建一个像这样的脚本,以在 evilwm 中启动 weston 并在 Weston 中启动 Xwayland(自定义 2 个 weston 窗口的位置)。最后,启动您想要的桌面环境:

# start weston with custom config and two output windows
weston --socket=wayland-1 --config=$HOME/myweston.ini --output-count=2 >$HOME/weston.log 2>&1 &
sleep 1 # wait until weston is ready

# get window id's from logfile and move windows at target (xwininfo could give id's, too)
xdotool windowmove 0x$(printf '%x\n' $(cat $HOME/weston.log | grep 'window id' | head -n1 | rev | cut -d' ' -f1 | rev))    0 0
xdotool windowmove 0x$(printf '%x\n' $(cat $HOME/weston.log | grep 'window id' | tail -n1 | rev | cut -d' ' -f1 | rev))    1369 400

# start X server Xwayland in weston
WAYLAND_DISPLAY=wayland-1 Xwayland :1 &
sleep 1 # wait until Xwayland is ready

# start your desired desktop environment
DISPLAY=:1 startlxde
Run Code Online (Sandbox Code Playgroud)

上面的启动脚本没有为 X 客户端设置 cookie 身份验证。相反,您也可以使用x11docker进行 cookie 身份验证:

# start weston and Xwayland, read X environment
read Xenv < <(x11docker --weston-xwayland --gpu --output-count=2 --westonini=$HOME/myweston.ini)

# move weston windows to target locations
xdotool windowmove $(xwininfo -name "Weston Compositor - X1" | grep "Window id" | cut -d' ' -f4) 0 0
xdotool windowmove $(xwininfo -name "Weston Compositor - X2" | grep "Window id" | cut -d' ' -f4) 1367 400

# start desired desktop environment
env $Xenv startlxde
Run Code Online (Sandbox Code Playgroud)

Xwayland作为weston的客户端“窗口”出现。不幸的是,由于 Weston 或 Xwayland 的错误,它并不总是位于 0:0 的位置。您可以使用[META]+鼠标左键将Xwayland移动到所需位置。我写了一份错误报告,但没有得到回应。