A Hammerspoon configuration which rests you assured that you will aways have a right input source in apps where you need it.
I'm Russian developer but want to always have English input source in some dev applications like iTerm, IDEA, Android Studio, etc. Unfortunately in some cases MacOS can't guarantee that (which is annoying), but this script fixes that issue.
- Ensure that you have MacOS with the latest Hammerspoon installed.
- Copy & paste the code from init.lua to your Hammerspoon Config file.
- Check
target_lang
andtarget_apps
values in the code — edit them for your specific needs or leave as is. - Save Config file and reload it in Hammerspoon.
- Viola!
- You may also want to enable launching Hammerspoon at login in Preferences.
This script only sets the desired input source when you switch focus to specified apps. You will be able to change the input source when already focused on the app. The non-target apps input source behaviour won't be affected.
This project is licensed under the MIT License.