A utility program to manipulate Input Sources on Mac OS X.

This is a rewrite of minoki/InputSourceSelector in Swift with addition of a few useful features: testing for a layout ID and displaying the language code for the input method.

For a more robust solution that works aroung MacOs errors, check out laishulu/macism.


$ git clone
$ cd InputSourceSelector
$ make
$ copy InputSourceSelector /usr/local/bin/    # or another directory in $PATH


Running it without arguments prints usage information:

$ InputSourceSelector
   InputSourceSelector [command]

Available commands:
   list                        Lists currently installed input sources.
   list-enabled                Lists currently enabled input sources.
   current                     Prints currently selected input source.
   current-layout              Prints currently used keyboard layout.
   enable [input source ID]    Enables specified input source.
   disable [input source ID]   Disables specified input source.
   select [input source ID]    Selects specified input source.
   deselect [input source ID]  Deselects specified input source.
   test-id [input source ID]   Tests input source ID for correctness.

Where input source ID is something like

Output examples

$ InputSourceSelector list (Czech – QWERTY) [cs] (Czech) [cs] (Estonian) [et] (Hungarian – QWERTY) [hu]
.... (270 lines skipped) (Wubi - Simplified) [zh-Hans] (Stroke - Simplified) [zh-Hans] (Marathi – Transliteration (A→अ)) [mr] (Punjabi – Transliteration (A→ਅ)) [pa] (Urdu – Transliteration (A→ع)) [ur] (Gujarati – Transliteration (A→અ)) [gu] (Hindi – Transliteration (A→अ)) [hi] (Bangla – Transliteration (A→অ)) [bn]

$ InputSourceSelector list-enabled (Emoji & Symbols) [en] (U.S.) [en] (Dictation) [en]
org.unknown.keylayout.Русская-BG46 (Русская - BG46) []

$ InputSourceSelector current (U.S.) [en]

$ InputSourceSelector current-layout (U.S.) [en]
$ InputSourceSelector select   # US layout is selected

$ InputSourceSelector test-id : ok
$ echo $?

$ InputSourceSelector test-id qwe
qwe : bad input source ID. Use 'list' or 'list-enabled' to get some valid ones.
$ echo $?


View Github