xrandr to set display to use single monitor, even if you have another monitor connected or disconnected
I have a laptop that can move and be connected to different monitors etc through out the day.
I usually exit my windows manager and login again every time I disconnect, to have this done automatically for me.
I would like to stay logged in and use the same tool that does the auto-detection and set up or doing it using xrandr. I guess I am just unfamiliar with the different tools available.
- With my work secondary monitor connected. I get the following.
xrandr
Screen 0: minimum 8 x 8, current 3286 x 1080, maximum 32767 x 32767
LVDS1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1366x768 60.0*+
1360x768 59.8 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1920x1080+1366+0 (normal left inverted right x axis y axis) 510mm x 287mm
1920x1080 60.0*+ 50.0 59.9
1680x1050 59.9
1600x900 60.0
1280x1024 75.0 60.0
1440x900 59.9
1280x800 59.9
1152x864 75.0
1280x720 60.0 50.0 59.9
1024x768 75.1 70.1 60.0
832x624 74.6
800x600 72.2 75.0 60.3 56.2
720x576 50.0
720x480 60.0 59.9
640x480 75.0 72.8 66.7 60.0 59.9
720x400 70.1
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
- If I unplug this monitor to move my laptop. I loose every thing on that screen. Its still running but I can see it.
# xrandr
Screen 0: minimum 8 x 8, current 3286 x 1080, maximum 32767 x 32767
LVDS1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1366x768 60.0*+
1360x768 59.8 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected 1920x1080+1366+0 (normal left inverted right x axis y axis) 0mm x 0mm
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
1920x1080 (0x49) 148.5MHz
h: width 1920 start 2008 end 2052 total 2200 skew 0 clock 67.5KHz
v: height 1080 start 1084 end 1089 total 1125 clock 60.0Hz
- If I am already logged in I only see the output of the first monitor, even after connecting the second monitor.
# xrandr Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767 LVDS1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm 1366x768 60.0*+ 1360x768 59.8 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
DP1 disconnected (normal left inverted right x axis y axis) HDMI1 connected (normal left inverted right x axis y axis) 1920x1080 60.0 + 50.0 59.9
1680x1050 59.9
1600x900 60.0
1280x1024 75.0 60.0
1440x900 59.9
1280x800 59.9
1152x864 75.0
1280x720 60.0 50.0 59.9
1024x768 75.1 70.1 60.0
832x624 74.6
800x600 72.2 75.0 60.3 56.2
720x576 50.0
720x480 60.0 59.9
640x480 75.0 72.8 66.7 60.0 59.9
720x400 70.1
VGA1 disconnected (normal left inverted right x axis y axis) VIRTUAL1 disconnected (normal left inverted right x axis y axis)