Switch keyboard from terminal? Is there a command line equivalent to pressing ctrl-space to toggle the keyboard layout? (I need this because I want to use Karabiner to tap shift to toggle.)
Make an applescript:

tell application "System Events"
    keystroke " " using control down
end tell

PS. This is too slow, and allows more keys from the old keyboard to be entered before the switch is effectual.