ubuntu18.04设置外接显示器(开启and关闭)

  1. 执行xrandr,查看输出接口
    输出:
Screen 0: minimum 8 x 8, current 3360 x 1080, maximum 32767 x 32767
HDMI-0 connected 1440x900+1920+0 (normal left inverted right x axis y axis) 410mm x 256mm
   1440x900      59.89*+  74.98  
   1920x1080     59.94  
   1280x1024     76.00    75.02    70.00    60.02  
   1280x720      59.94  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x640       59.99  
   800x600       75.00    72.19    60.32    56.25  
   720x480       59.94    59.94  
   640x480       75.00    72.81    65.99    59.94  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
eDP-1-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
   1920x1080     60.01*+  40.00  
DP-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 disconnected (normal left inverted right x axis y axis)

其中HDMI-0是HDMI接口外接的显示屏,eDP-1-1是笔记本屏幕
2、关闭外接(or 笔记本)屏幕

sudo xrandr --output HDMI-0(eDP-1-1) --off

这个时候已经关闭了屏幕
3、重新打开屏幕

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

----right-of是将外接屏设置为内置屏幕的右侧扩展屏
–auto是自动设置分辨率

你可能感兴趣的:(ubuntu18.04设置外接显示器(开启and关闭))