Determine OS X keyboard layout (“input source”) in the terminal/a script?

后端 未结 6 1428
感情败类
感情败类 2020-12-23 15:25

I would like to determine the OS X keyboard layout (or \"input source\" as OS X calls it) from the terminal so that I can show it in places like the tmux status bar.

6条回答
  •  无人及你
    2020-12-23 15:55

    I was searching for an answer to an issue I was having with the keyboard layout that lead me to this post. I found the solution for my problem here.

    Resolved Issues You might experience difficulty logging into your account because the keyboard layout may change unexpectedly at the Login window. (40821875)

    Workaround: Log in to your account, launch Terminal, and execute the following command:

    sudo rm -rf /var/db/securityagent/Library/Preferences/com.apple.HIToolbox.plist
    

    This is an Apple official release note for Mojave

提交回复
热议问题