myshov / xkbswitch-macosx

Console keyboard layout switcher for MacOS
218 stars 26 forks source link

Switching by number changes only for -s 0 and -s 2 but not -s 1 #7

Closed JezuzStardust closed 6 years ago

JezuzStardust commented 6 years ago

With two layouts in my input sources (Swedish-Pro and U.S) I get a strange behaviour. When

xkbswitch -s 1

does nothing, while

xkbswitch -s 0

switches to Swedish-Pro and

xkbswitch -s 2

switches to U.S. layouts. Is this behaviour expected?

myshov commented 6 years ago

@JezuzStardust hi! Yes that expected behaviour because of strange logic behind layouts in macOS that gives not sequential identifiers 😄 This numbers are system level identifiers of the keyboard layouts. For example I have only Russian and English layouts. When English layout is chosen xkbswitch -g gives me 0, but when Russian layout is chosen xkbswitch -g gives 3.

myshov commented 6 years ago

@JezuzStardust I am closing this issue, feel free to reopen it if you think that we need to handle this case somehow.