A minimal macOS menu bar app that switches keyboard layouts using F-keys.
If you need to type in more than 2 languages on Mac, you are screwed.
Well, not really, but even using CapsLock - something I thoroughly recommend - is hard
to adjust for 3+ languages. kbsw comes to the rescue.
- Runs as a menu bar icon (no dock icon, no window)
- Global hotkeys: F1–F12 to switch keyboard layouts
- YAML configuration
- Launch at Login toggle
./scripts/build-app.sh
cp -r build/kbsw.app /Applications/Requires macOS 13 (Ventura) or later. You will need to grant A11Y permissions for the app to work, and restart it manually. Possibly several times - I couldn't quite figure it out.
Edit ~/.config/kbsw/config.yaml:
shortcuts:
F1: com.apple.keylayout.ABC
F2: com.apple.keylayout.RussianWinTo list available input source IDs on your system:
kbsw --listSee keyboard-layouts.txt for a full reference of built-in macOS layouts.
As I said above, the app requires accessibility access to capture global hotkeys. On first launch, macOS will prompt you to grant this in System Settings → Privacy & Security → Accessibility.
If F-keys trigger media controls instead, enable "Use F1, F2, etc. keys as standard function keys" in System Settings → Keyboard, or hold fn when pressing.
swift build
swift run