Skip to content

Saba-Sabato/fn-lang-switcher

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 

Repository files navigation

THE PROBLEM:

ezgif-5-86271457e6

Not only is it slow, when the mouse cursor happens to be in the center of the screen, you might end up selecting the wrong language!

THE SOLUTION (get rid of the pop up):

We're going to set up a process that runs on startup, intercepts the fn key and fulfills exactly the same action - except without the annoying pop-up.

  1. (Ventura) Go to System Settings -> Keyboard -> set this to "Do Nothing" ezgif-5-aeb126ae5e
  2. Allow zsh to monitor and modify your keyboard input:
    1. Go to System Settings -> Privacy & Security -> Accessibility -> + -> type CMD+SHIFT+G
    2. In the little text box, paste /bin/zsh.
    3. Mark it as active: zsh.png

Option 1 (all in one script)

# Install issw 
brew install cmake
git clone https://github.com/norflin321/input-source-switcher.git
pushd .
cd input-source-switcher
mkdir build && cd build
cmake ..
make
sudo make install
popd
rm -rf input-source-switcher

# Create launchd directory
mkdir ~/Library/LaunchAgents/fn_lang_switcher
# Get plist and python script
curl --request GET -sL \
     --remote-name-all\
     --output-dir ~/Library/LaunchAgents/fn_lang_switcher/\
     --url 'https://github.com/norflin321/fn-lang-switcher/raw/main/fn.py'\
     --url 'https://github.com/norflin321/fn-lang-switcher/raw/main/fn.plist'

# Start the process
launchctl load -w ~/Library/LaunchAgents/fn_lang_switcher/fn.plist
# To stop the process at a future point in time:
# launchctl unload -w ~/Library/LaunchAgents/fn_lang_switcher/fn.plist

You're good to go! Enjoy.

Option 2: manually

  1. Install issw, a small utility for macOS to switch input sources from the command line. By default, the program will be installed as /usr/local/bin/issw.
    (you may need to brew install cmake if you haven't already)
    git clone https://github.com/norflin321/input-source-switcher.git
    cd input-source-switcher
    mkdir build && cd build
    cmake ..
    make
    make install
  1. Download fn.py and fn.plist (right click -> save as). Place them both in your Downloads folder.
  2. Copy the plist file (service specification) and the python script to launchctl:
    1. mkdir ~/Library/LaunchAgents/fn_lang_switcher
    2. cp ~/Downloads/fn.plist ~/Downloads/fn.py ~/Library/LaunchAgents/fn_lang_switcher/
  3. Set the process to load on system startup: launchctl load -w ~/Library/LaunchAgents/fn_lang_switcher/fn.plist
    To stop it at a future date, run launchctl unload -w ~/Library/LaunchAgents/fn_lang_switcher/fn.plist

RESULT:

You can toggle input source with "fn" button, but without showing the pop up!

About

disable macos change input source pop up

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%