There's an easy to use GUI called "arandr" for changing your monitor settings. It's a GUI frontend for the xrandr
command line utility.
You can use the xrandr utility from command line to switch back and forth between single and dual screen. In my zshrc (or your Bash login file if you use Bash) I have defined the 'single()' and 'dual()' functions for this.
Your outputs will probably be different - I have one HDMI and one VGA - look for an xrandr tutorial for more detail. In this example, the VGA output is my primary monitor, and the HDMI monitor is to the right of my primary monitor.
# set dual monitors
dual () {
xrandr --output VGA-0 --primary --left-of HDMI-0 --output HDMI-0 --auto
}
# set single monitor
single () {
xrandr --output HDMI-0 --off
}
I like this because at any point I simply send the single
or dual
command to my terminal and turn my second monitor on and off.