What do you mean by switch? Change which is the primary display? If so, there's no quick way of doing so, you just have to open display prefs and drag the top bar to the other display. You might be able to write an applescript to automate the process though.