Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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/com.apple.HIToolbox.*); defaults write ${plist%.*} AppleCurrentKeyboardLayoutInputSourceID -string com.apple.keylayout.US; killall SystemUIServer. I couldn't get that to work myself though. –  ؘؘؘؘ Jun 24 '11 at 3:36

1 Answer 1

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

 
discard

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.