I have a laptop with two video outputs that I use when I am home (HDMI1,VGA1). To enable them, I do this:
xrandr --output HDMI1 --right-of LVDS1 --auto
xrandr --output LVDS1 --off
xrandr --output VGA1 --right-of HDMI1 --auto
When I want to go to work, I take my laptop but first run the following:
xrandr --output VGA1 --off
xrandr --output LVDS1 --left-of HDMI1 --auto
xrandr --output HDMI1 --off
And then this leaves my laptop display active just like it should.
The problem I am encountering is that sometimes I don't remember to disable the two screens before taking my computer to work. When I arrive, I try various combinations of --output and --off but I cannot get my screen re-enabled.
This is the output I get running xrandr with nothing displayed:
Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 8192 x 8192
LVDS1 connected (normal left inverted right x axis y axis)
1366x768 60.0 +
1024x768 60.0··
800x600 60.3 56.2··
640x480 59.9··
VGA1 disconnected 1920x1080+1920+0 (normal left inverted right x axis y axis) 0mm x 0mm
HDMI1 disconnected 1920x1080+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
DP1 disconnected (normal left inverted right x axis y axis)
1920x1080 (0x4c) 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
Almost every command I've tried returns:
xrandr: Configure crtc 2 failed
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 21 (RRSetCrtcConfig)
Serial number of failed request: 40
Current serial number in output stream: 40
It's like the two monitors aren't giving up their CRTC and since my hardware only supports 2, it's locked in until I plug those monitors in and disable them.