Skip to content

sgzmd/kbsw

Repository files navigation

kbsw

A minimal macOS menu bar app that switches keyboard layouts using F-keys.

Problem

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.

Features

  • 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

Install

./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.

Configuration

Edit ~/.config/kbsw/config.yaml:

shortcuts:
  F1: com.apple.keylayout.ABC
  F2: com.apple.keylayout.RussianWin

To list available input source IDs on your system:

kbsw --list

See keyboard-layouts.txt for a full reference of built-in macOS layouts.

Permissions

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.

Build from source

swift build
swift run

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors