This setup ensures Lang Switcher is always running on macOS.
If the app crashes or is accidentally closed, it will automatically restart.
Unlike open -a, this method avoids stealing focus every time Lang Switcher launches.
-
Open Terminal and create a LaunchAgents folder (if it doesn’t exist):
mkdir -p ~/Library/LaunchAgents -
Create a new service file:
nano ~/Library/LaunchAgents/com.user.LangSwitcher.plist -
Paste the following content:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.user.LangSwitcher</string> <key>LimitLoadToSessionType</key> <string>Aqua</string> <key>ProgramArguments</key> <array> <string>/usr/bin/open</string> <string>-g</string> <string>-W</string> <string>-a</string> <string>Lang Switcher</string> </array> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/> <!-- optional: reduce “respawn spam” if something crashes fast --> <key>ThrottleInterval</key> <integer>1</integer> </dict> </plist>
-
Load the service:
launchctl load ~/Library/LaunchAgents/com.user.LangSwitcher.plist
- Now, Lang Switcher will always stay open.
- If you close it manually or it crashes,
launchdwill restart it automatically. - To disable the service:
launchctl unload ~/Library/LaunchAgents/com.user.LangSwitcher.plist