Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I change the keyboard layout to Dvorak on a mac, using the terminal? What is the defaults write setting for the keyboard layout?

share|improve this question
An answer in the third question suggests something like plist=$(find ~/Library/Preferences/ByHost/*); defaults write ${plist%.*} AppleCurrentKeyboardLayoutInputSourceID -string; killall SystemUIServer. I couldn't get that to work myself though. – user495470 Jun 24 '11 at 3:36
up vote 0 down vote accepted

This snippet did the trick for me. Note that I use Quicksilver to launch apps, so I remapped the keyboard shortcut for "switch input menu" from Cmd+Space to Option+Cmd+S.

osascript -e 'tell application "System Events"' \
          -e 'keystroke "s" using {command down, option down}' \
          -e 'end tell'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.