Yes, this is the right incantation. I've brushed it up a little:
$ cat ~/bin/dock #! /bin/sh -e xrandr --output LVDS --off --fb 3200x1200 && \ xrandr --output DFP1 --auto --output CRT1 --auto --right-of DFP1
$ cat ~/bin/laptop #! /bin/sh xrandr --output CRT1 --off 2> /dev/null xrandr --output LVDS --auto --output DFP1 --off 2> /dev/null || xrandr --auto
$
Yes, this is the right incantation. I've brushed it up a little:
$ cat ~/bin/dock
#! /bin/sh -e
xrandr --output LVDS --off --fb 3200x1200 && \
xrandr --output DFP1 --auto --output CRT1 --auto --right-of DFP1
$ cat ~/bin/laptop
#! /bin/sh
xrandr --output CRT1 --off 2> /dev/null
xrandr --output LVDS --auto --output DFP1 --off 2> /dev/null ||
xrandr --auto
$