MacOS – How to set “Input Sources” for all users at the same time

input-sourcemacospreferencesserveradminsettings

In Lion OSX, changing the keyboard layout "Input Sources" setting in the "Language & Text" only changes the setting for the current user. Is there a way to populate the setting to all existing, and also all future new users to the same set of language keyboard layouts?

Best Answer

The default input source is set in ~/Library/Preferences/ByHost/com.apple.HIToolbox.*.plist (where * is system_profiler | grep 'Hardware UUID').

You could either copy the file to other acccounts: sudo cp ~/Library/Preferences/ByHost/com.apple.HIToolbox.*.plist ~/Users/username/Library/Preferences/ByHost/.

Or add it to the User Template directory so that it will be included by default on new accounts: d=/System/Library/User\ Template/English.lproj/Library/Preferences/ByHost; sudo mkdir -p "$d"; sudo cp ~/Library/Preferences/ByHost/com.apple.HIToolbox.*.plist "$d".

Note that the UUID will have to be changed if the file is copied to another computer.

You can view or edit the property list in a text editor by converting it from binary to XML: f=~/Library/Preferences/ByHost/com.apple.HIToolbox.*.plist; plutil -convert xml1 $f; open $f -a TextEdit.