OSX - Automatically change input source for different keyboards
-- EDIT 12/2020--
I no longer maintain autokbisw since I don't own a mac laptop anymore, I am willing to give access or transfer whatever needs transferring if anyone is up for it, ping me on github. (Also such a tool doesn't seem to exist for linux either, I'm going to have to read up on these APIS \o/)
Since I was unable to find any existing way to do this, I created autokbisw.
autokbisw (automatic keyboard input source switcher) will remember the last chosen input source for each keyboard it 'sees' and restore the corresponding input source every time the keyboard becomes active. The "active" keyboard is the last keyboard to send an input event. Whenever the input source changes externally, it will update the input source for the active keyboard.
This way the input source behaves as if the input source selector was specific to a keyboard and not to the system. Same as the keyboard layout.
autokbisw works wonderfully !!
Simply brew install it, enable service, and keyboard switching is now automatic !!
brew install jeantil/autokbisw/autokbisw
brew services start jeantil/autokbisw/autokbisw