Talk:Sample Fn-F7 script
Note: you will need to change the internal and external resolution until someone fixes this script to figure it out from xrandr, you may also need to change output names from "VGA" and "LVDS" to what your xrandr tells you.
why not just use --auto ?
xrandr --output VGA --auto
xrandr --output VGA --off
xrandr --output LVDS --auto
xrandr --output LVDS --off
Good point, made the changes --seva