Does exists some console utility for keyboard layout switching in Mac OS X? For example, there is xkb-switch on Linux. Is there some analog in Mac OS X? I googled but found nothing. Yes I know about AppleScript but it doesn't fit to my purposes.
Ok. I wrote it myself.
If you need one see code of utility here (https://github.com/myshov/xkbswitch-macosx) if you want in bin directory there is already compiled version.