如何确定远程系统上显示器的分辨率。如果我使用xrandr
它会显示本地屏幕的分辨率:
me@rome:~$ ssh -X road
me@road's password:
Welcome to Ubuntu 17.10 (GNU/Linux 4.13.0-16-generic i686)
me@road:~$ xrandr
Screen 0: minimum 320 x 200, current 1440 x 900, maximum 8192 x 8192
VGA-1 connected primary 1440x900+0+0 (normal left inverted right x axis y axis) 370mm x 230mm
1440x900 59.89*+
1280x1024 75.02 60.02
1280x960 60.00
1152x864 75.00
1024x768 75.03 60.00
832x624 74.55
800x600 75.00 60.32
640x480 75.00 59.94
720x400 70.08
HDMI-1 disconnected (normal left inverted right x axis y axis)
答案1
ssh 进入您的服务器,然后导出本地显示 ( echo $DISPLAY
):
export DISPLAY=:0
然后运行xrandr
或者简单地运行
DISPLAY=:0 xrandr