I wrote a short, simple shell script to easily enable and disable my secondary monitor in Ubuntu. I have saved it as monitor.sh in my home folder, and here is the source code:
#!/bin/sh echo "Turn on: 1\nTurn off: 2" read option if [ $option = 1 ]; then xrandr --output DFP2 --auto --left-of DFP1 elif [ $option = 2 ]; then xrandr --output DFP2 --off fi
To run it, just open a terminal window (Ctrl + Alt + T) and type sh monitor.sh. If you are really lazy, you can add an alias for the command in the file .bashrc in your home folder. I named my alias m.