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?
Asked
Active
Viewed 3,880 times
4
studiohack
- 13,490
Kevin Burke
- 929
- 4
- 13
- 30
1 Answers
1
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'
Kevin Burke
- 929
- 4
- 13
- 30
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. – Lri Jun 24 '11 at 03:36