Hi All,
Just positing this on the off chance anyone may know or can link me a list of keyboard codes, the numerical value that I can use in my first run script, (yes I have googled it before that comes back!). For a little context here's an excerpt of the script i'm amending for setting the Australia locale:
#!/bin/sh
PLBUDDY=/usr/libexec/PlistBuddy
KEYBOARDNAME="Australian"
KEYBOARDCODE="2"
LANG="en"
REGION="en_AU"
ARD="/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart"
SUBMIT_TO_APPLE=NO
SUBMIT_TO_APP_DEVELOPERS=NO
###############
## functions ##
###############
update_kdb_layout() {
${PLBUDDY} -c "Delete :AppleCurrentKeyboardLayoutInputSourceID" "${1}" &>/dev/null
if [ ${?} -eq 0 ]
then
${PLBUDDY} -c "Add :AppleCurrentKeyboardLayoutInputSourceID string com.apple.keylayout.${KEYBOARDNAME}" "${1}"
fi
for SOURCE in AppleDefaultAsciiInputSource AppleCurrentAsciiInputSource AppleCurrentInputSource AppleEnabledInputSources AppleSelectedInputSources
do
${PLBUDDY} -c "Delete :${SOURCE}" "${1}" &>/dev/null
if [ ${?} -eq 0 ]
then
${PLBUDDY} -c "Add :${SOURCE} array" "${1}"
${PLBUDDY} -c "Add :${SOURCE}:0 dict" "${1}"
${PLBUDDY} -c "Add :${SOURCE}:0:InputSourceKind string 'Keyboard Layout'" "${1}"
${PLBUDDY} -c "Add :${SOURCE}:0:KeyboardLayout ID integer ${KEYBOARDCODE}" "${1}"
${PLBUDDY} -c "Add :${SOURCE}:0:KeyboardLayout Name string '${KEYBOARDNAME}'" "${1}"
fi
done
}
update_language() {
${PLBUDDY} -c "Delete :AppleLanguages" "${1}" &>/dev/null
if [ ${?} -eq 0 ]
then
${PLBUDDY} -c "Add :AppleLanguages array" "${1}"
${PLBUDDY} -c "Add :AppleLanguages:0 string '${LANG}'" "${1}"
fi
}
update_region() {
${PLBUDDY} -c "Delete :AppleLocale" "${1}" &>/dev/null
${PLBUDDY} -c "Add :AppleLocale string ${REGION}" "${1}" &>/dev/null
${PLBUDDY} -c "Delete :Country" "${1}" &>/dev/null
${PLBUDDY} -c "Add :Country string ${REGION:3:2}" "${1}" &>/dev/null
}
Keyboard code "2" currently refers to UK - English. Any ideas?
Thanks,
Sachin