Make an alias in $HOME/.bash_aliases
# switch monitor mode
alias sm='function _switch_monitor(){ $HOME/switch_monitor.sh $1;};_switch_monitor'
Here is an example of xrandr settings for switching between the built-in screen and the dual screen config (built-in uses a new mode no present by default)
#!/bin/bash