In an effort to create a workaround:
I created a version of this to select a given input. The original version only selected enabled inputs, whereas my version will run enable the input (if necessary) and switch to it.
This allows us to create an apple script and save it as an application which can then be run on login:
set executablePath to quoted form of "/Applications/changeInputSource"
set inputSourceID to "com.apple.keylayout.British"
do shell scriptexecutablePath&" "&inputSourceID
Note: in our particular case this will leave US English as an input and show the input menu in menu bar if this is selected.
You can download a compiled version with source code and the example applescript here.
Note: The apple script assumes you will place the compiled application "changeInputSource" into /Applications/
You can refer to the original message on how to compile the source, assuming you create the file on the Desktop I used an additional parameter with my version of the XCode compiler highlighted in bold:
cd ~/Desktop; gcc "changeInputSource.m" -o "changeInputSource" -l objc -framework foundation -framework carbon -std=c99
#import <Foundation/Foundation.h>
#import <Carbon/Carbon.h>
BOOL changeInputSourceTo(NSString *inputID, BOOL checkAllInstalledInputs) {
BOOL b = NO;
NSMutableString *thisID;
TISInputSourceRef inputSource = NULL;
CFArrayRef availableInputs = TISCreateInputSourceList(NULL, checkAllInstalledInputs);
NSUInteger count = CFArrayGetCount(availableInputs);
for (int i = 0; i < count; i++) {
inputSource = (TISInputSourceRef)CFArrayGetValueAtIndex(availableInputs, i);
CFStringRef type = TISGetInputSourceProperty(inputSource, kTISPropertyInputSourceCategory);
if (!CFStringCompare(type, kTISCategoryKeyboardInputSource, 0)) {
thisID = TISGetInputSourceProperty(inputSource, kTISPropertyInputSourceID);
if (b) {
printf("%s\n", [thisID UTF8String]);
} else if ([thisID isEqualToString:inputID]) {
b = YES;
OSStatus err = TISEnableInputSource(inputSource);
if (err) {
printf("Error %i\n", (int)err);
}
err = TISSelectInputSource(inputSource);
if (err) printf("Error %i\n", (int)err);
break;
}
}
}
CFRelease(availableInputs);
return b;
}
int main (int argc, const char *argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *inputID;
if (argc >= 2){
inputID = [NSString stringWithUTF8String:argv[1]];
if(!changeInputSourceTo(inputID,NO)) {
if(!changeInputSourceTo(inputID,YES)){
printf("not available\n");
}
}
}
[pool release];
return 0;
}