Skip to content

Latest commit

 

History

165 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeSwitch icon

TypeSwitch

TypeSwitch is a native macOS menu bar utility for switching input methods per app. Choose how each app should behave, set the rule for unconfigured apps, and let TypeSwitch switch to the right input method when the frontmost app changes.

Swift Platform License Homebrew Release PRs Welcome

🇨🇳 简体中文 · 🇺🇸 English

🖼️ Screenshots

TypeSwitch light appearance showing the main menu and current-app input method strategy

TypeSwitch dark appearance showing the main menu and current-app input method strategy

✨ Highlights

  • Switch automatically by app. TypeSwitch watches the frontmost app and applies its saved input method rule as you move between apps, except for apps you choose to ignore.
  • Choose the behavior that fits. Let an app inherit the default rule, remember its Last Switch, select a Specific Input Method, or ignore apps you do not want TypeSwitch to manage.
  • Configure apps where you find them. Set a rule for the current app, review running apps by configuration status, or manage every saved rule without leaving the menu bar.
  • Keep rules and results tidy. Find rules for missing apps, remove stale settings, review successful switch counts, and clear statistics when needed.
  • Fit TypeSwitch into your workflow. Launch it at login, let Sparkle check silently for updates, open project and support links from Help & About, or press Command + Q to quit.

🪶 Native and Lightweight

  • Truly native. TypeSwitch's app business code is written in Swift and built with SwiftUI and The Composable Architecture (TCA). It uses MenuBarExtra and LSUIElement instead of an Electron runtime or embedded WebView.
  • Focused and lightweight. TypeSwitch runs as a menu bar utility without shipping a browser engine or server component. App rules, the default rule, and switch statistics stay on your Mac.
  • At home on macOS. The interface follows Light and Dark Mode automatically. On macOS 26, native SwiftUI controls use the system-provided Liquid Glass appearance where appropriate, while macOS 14 and macOS 15 retain their native system styling. TypeSwitch does not simulate Liquid Glass with custom visual effects.
  • Built for modern Macs. The release workflow uses Xcode 26.5 and verifies every release as a Universal Binary for both Apple Silicon and Intel Macs.

💻 System Requirements

  • macOS 14.0 or later
  • Enabled macOS keyboard layouts or input methods
  • macOS permissions needed for app activation monitoring, system input method switching, and optional Login Items

📦 Installation

Homebrew

The brew trust command first shipped with Homebrew 5.1.15 on June 3, 2026. In Homebrew 5.1.15 through 5.x, trust was required only when HOMEBREW_REQUIRE_TAP_TRUST=1 was set. Starting with Homebrew 6.0.0 on June 11, 2026, casks from non-official taps require explicit trust by default.

brew tap ygsgdbd/tap
brew trust --cask ygsgdbd/tap/typeswitch
brew install --cask typeswitch

This trusts only the third-party typeswitch cask, not the entire tap. Homebrew stores the trust entry, so you normally need to run the trust command only once. The cask also includes a custom postflight step that removes the macOS quarantine attribute from TypeSwitch after installation. TypeSwitch is still unsigned and not notarized, and brew trust is not an official Gatekeeper certification. See Homebrew's Tap Trust documentation for details.

Homebrew 5.1.14 and earlier do not have brew trust and do not require it:

brew tap ygsgdbd/tap
brew install --cask typeswitch

If brew trust reports Unknown command: trust, skip that command or run brew update to upgrade Homebrew.

Update Homebrew installations with:

brew upgrade typeswitch

Tap Trust Troubleshooting

  • If Homebrew reports Refusing to load cask ... from untrusted tap, run brew trust --cask ygsgdbd/tap/typeswitch, then retry the installation or upgrade.
  • If brew doctor reports that ygsgdbd/tap is untrusted, trust only the TypeSwitch cask with the command above; trusting the entire tap is not required.
  • If an existing installation stops upgrading after Homebrew is updated to 6.0.0 or later, trust the cask and retry brew upgrade typeswitch.
  • To trust every current and future formula, cask, and external command in the tap, use brew trust ygsgdbd/tap. This grants broader access and is not the recommended option.

Manual Installation

  1. Download the latest build from Releases.
  2. Drag TypeSwitch.app to the Applications folder.
  3. In Applications, Control-click or right-click TypeSwitch.app, choose Open, then confirm that you want to open it.
  4. If macOS still blocks the app, open System Settings → Privacy & Security, find the TypeSwitch security message, and choose Open Anyway.
  5. Grant any system permissions macOS requests.
  6. TypeSwitch checks GitHub Releases silently. When a new version is available, the menu shows its version; click it to open the update window.

🧭 Usage

  1. Launch TypeSwitch. Its keyboard icon appears in the menu bar.
  2. Open the menu and use Current App to configure the frontmost app.
  3. Use Running · Unconfigured to assign rules to running apps that do not have one yet.
  4. Use Running · Configured and All Configured Apps to review and change existing app rules.
  5. For each app, choose Default to inherit the fallback, Last Switch, or a specific input method.
  6. Choose Ignore This App to stop automatic switching and hide the app from the regular lists. Restore one or all apps from Ignored Apps to recover their previous rules.
  7. Use Default Rule for Unconfigured Apps to set the fallback behavior for apps without their own rule.
  8. Check Missing Apps and Switches when you want to clean missing rules or review successful switches.

🔒 Privacy and Permissions

  • App rules, the Default Rule for Unconfigured Apps, and switch statistics are stored locally.
  • TypeSwitch has no server-side component in this repository.
  • TypeSwitch contacts its GitHub appcast at startup and periodically while running to check for updates. Background checks only update the menu status and never present UI, download, or install automatically; the Sparkle update window opens only after you click Check for Updates… or New Version … Available….
  • Input method switching uses macOS system input sources.
  • Launch at Login uses macOS Login Items, with a LaunchAgent fallback when needed.

🧰 Tech Stack

This project uses:

  • The Composable Architecture 1.26.0 for app architecture and state management
  • Sharing 2.9.1 for file-backed shared state
  • Sparkle 2.9.4 for silent automatic checks, manual updates, and appcast support
  • Point-Free support libraries: CasePaths, Dependencies, and PerceptionCore
  • Tuist for project generation and build configuration

🧪 Development

Requirements

  • Xcode 26.5+
  • Swift 5.9+
  • macOS 14.0+
  • just
  • Tuist
  • SwiftFormat (version pinned in .swiftformat-version)
  • ImageMagick
  • RTK (rtk, required by the screenshot generation script)

Build Steps

Install the required development tools:

brew install just swiftformat
brew tap tuist/tuist
brew install --formula tuist

Clone and generate the Xcode project:

git clone https://github.com/ygsgdbd/TypeSwitch.git
cd TypeSwitch
tuist generate
open TypeSwitch.xcworkspace

Run the same formatting and test checks required by pull requests:

just check

To regenerate the deterministic, privacy-safe README screenshots, grant your terminal or Codex Screen Recording and Accessibility permissions, quit other running TypeSwitch instances, and run:

./script/generate_readme_screenshots.sh

Release Workflow

Production releases are built by GitHub Actions when a strict, annotated vX.Y.Z tag on main is pushed:

git tag -a v0.10.0 -m "TypeSwitch v0.10.0"
git push origin v0.10.0

The workflow validates the tag, runs tests, builds a universal macOS app, packages a zip, publishes its SHA-256 checksum, signs the Sparkle appcast.xml with EdDSA, generates a GitHub Artifact Attestation for the release zip, publishes a GitHub Release, and updates the Homebrew cask.

Do not dispatch or rebuild an already published tag. If a release run fails, rerun only its failed jobs from the Actions UI, or use:

FAILED_RUN_ID=123456789 # Replace with the failed workflow run ID.
gh run rerun "$FAILED_RUN_ID" --failed --repo ygsgdbd/TypeSwitch

If the release guard reports that an incomplete draft Release already exists, inspect it first:

gh release view v0.10.0 --repo ygsgdbd/TypeSwitch --json isDraft,url,assets

Only after confirming isDraft is true, delete that draft without deleting the tag, then rerun only the failed jobs:

gh release delete v0.10.0 --repo ygsgdbd/TypeSwitch --yes
FAILED_RUN_ID=123456789 # Replace with the failed workflow run ID.
gh run rerun "$FAILED_RUN_ID" --failed --repo ygsgdbd/TypeSwitch

The workflow refuses to rebuild or overwrite a completed, published Release. Publish fixes under a new SemVer tag instead.

After downloading the release zip, verify its build provenance with GitHub CLI:

gh attestation verify TypeSwitch-macOS-universal.zip --repo ygsgdbd/TypeSwitch

🙏 Acknowledgments

TypeSwitch was inspired by:

  • SwitchKey, an input method switcher for macOS
  • The Swift and SwiftUI community
  • Contributors and users who shared feedback

About

A macOS app that automatically switches input methods for different applications. 自动切换不同应用输入法的 macOS 应用。

Topics

Resources

Stars

86 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages