Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ygsgdbd/TypeSwitch

Repository files navigation

TypeSwitch

TypeSwitch is a macOS menu bar utility for switching input methods per app.

It keeps the workflow in the menu bar: 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.

Screenshots

TypeSwitch menu bar interface

Menu bar interface for app rules, unconfigured apps, unavailable items, and switch statistics.

Features

  • Auto switch per app: Switch input methods when the active app changes.
  • Current App: Configure the frontmost app directly at the top of the menu.
  • Unconfigured and Running groups: Review running apps without rules separately from running apps that already have rules.
  • Configured apps: Manage saved app rules from the menu bar.
  • Unconfigured Apps rule: Set the fallback behavior for apps without their own rule.
  • Rule strategies: Choose Don't Switch, Last Switch, or a Specific Input Method.
  • Unavailable cleanup: Review rules for missing apps and clear unavailable settings.
  • Switch statistics: Track successful input method switches per app and clear the counts.
  • Launch at Login: Start TypeSwitch automatically after login, with a Login Items shortcut when macOS requires approval.
  • Manual update checks: Use Check for Updates... in the menu bar app for manual installs.
  • Quick project access: Open the GitHub repository from the menu.
  • Keyboard shortcut: Press Command + Q to quit TypeSwitch.

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

brew install ygsgdbd/tap/typeswitch --cask

Update Homebrew installations with:

brew upgrade typeswitch

Manual Installation

  1. Download the latest build from Releases.
  2. Drag TypeSwitch.app to the Applications folder.
  3. Launch TypeSwitch and grant any system permissions macOS requests.
  4. Use Check for Updates... from the menu bar app to check GitHub Releases for future updates.

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 Unconfigured to assign rules to running apps that do not have one yet.
  4. Use Running and Configured to review and change existing app rules.
  5. For each app, choose Default, Last Switch, Don't Switch, or a specific input method.
  6. Use Unconfigured Apps to set the fallback rule for apps without their own rule.
  7. Check Unavailable and Switches when you want to clean missing rules or review successful switches.

Privacy and Permissions

  • App rules, the unconfigured-apps rule, and switch statistics are stored locally.
  • TypeSwitch has no server-side component in this repository.
  • The GitHub link and Check for Updates... contact GitHub only when you use them.
  • 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 manual update checks and appcast support
  • SwifterSwift 8.0.0 for Swift extensions
  • Point-Free support libraries: CasePaths, Dependencies, and PerceptionCore
  • Tuist for project generation and build configuration

Development

Requirements

  • Xcode 15.0+
  • Swift 5.9+
  • macOS 14.0+
  • Tuist

Build Steps

Install Tuist:

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 tests:

tuist test

Release Workflow

Production releases are built by GitHub Actions when a vX.Y.Z tag is pushed:

git tag v0.6.0
git push origin v0.6.0

The workflow validates the tag, runs tests, builds a universal macOS app, packages a zip, generates checksums, creates a signed Sparkle appcast.xml, publishes a GitHub Release, and updates the Homebrew cask.

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

License

Stars

80 stars

Watchers

2 watching

Forks

Packages

 
 
 

Contributors

Languages