TypeSwitch is a modern macOS application built with SwiftUI for automatically switching input methods across different applications. Leveraging the latest Swift features and native macOS capabilities, it provides a seamless and efficient experience for managing input method preferences.
- 🔄 Auto Switch: Automatically switch to preset input methods when changing applications
- 🔍 Quick Search: Support fuzzy search for applications
- 🎯 Precise Match: Set independent input method preferences for each application
- 🚀 Auto Start: Support automatic startup
- ⌨️ Keyboard Shortcuts:
⌘ + F
- Quick search applications⌘ + R
- Refresh application list⌘ + Q
- Quit application
- 🎯 Quick Switch: Support customizable shortcut for switching current application's default input method
- 🖥 macOS 13.0 or later
- 🔐 Accessibility permission for monitoring application switches
- ⌨️ Input method switching permission
# Add tap
brew tap ygsgdbd/tap
# Install application
brew install --cask typeswitch
- Download the latest version from Releases
- Drag the application to Applications folder
- Grant necessary system permissions on first launch
- After launching, the app icon appears in the menu bar
- Click the menu bar icon to open the main interface
- Find the application you want to configure in the list
- Select the default input method for the application
- The input method will automatically switch when you switch to that application
TypeSwitch takes user privacy and security seriously:
- 🏠 All data is stored locally, nothing is uploaded to the network
- 🚫 No user information or usage data is collected
- 📖 Source code is fully open source and welcome for review
- 🛡️ Uses Swift's built-in security features
- 🔐 Permission usage:
- Accessibility: Only used for detecting application switches
- Input method switching: Only used for switching input methods
- Auto-start: Only used for launching at startup
This project uses the following open source libraries:
- Defaults (9.0.0) - For persistent settings storage
- SwiftUIX (0.1.9) - Provides additional SwiftUI components
- SwifterSwift (7.0.0) - Swift native extensions
- KeyboardShortcuts (2.2.2) - Add user-customizable global keyboard shortcuts
Build tools:
- Tuist - For project generation and management
- Xcode 15.0+
- Swift 5.9+
- macOS 13.0+
- Tuist
-
Install Tuist
-
Clone repository
git clone https://github.com/ygsgdbd/TypeSwitch.git
cd TypeSwitch
- Generate Xcode project
tuist generate
- Open and build
open TypeSwitch.xcworkspace
This project uses GitHub Actions for automated building and releasing:
- Push a new version tag to trigger automatic build:
git tag v1.0.0
git push origin v1.0.0
-
GitHub Actions will automatically:
- Build the application
- Create DMG package
- Release new version
- Generate changelog
-
Build artifacts can be downloaded from Releases
TypeSwitch/
├── Project.swift # Tuist project configuration
├── Tuist/ # Tuist configuration files
├── Sources/ # Source code
│ ├── Models/ # Data models
│ ├── Views/ # SwiftUI views
│ ├── ViewModels/ # View models
│ └── Utils/ # Utility classes
└── Tests/ # Test files
Pull requests and issues are welcome. Before submitting a PR, please ensure:
- Code follows project style
- Necessary tests are added
- Documentation is updated
This project is licensed under the MIT License. See LICENSE file for details.
This project was inspired by and received help from:
- SwitchKey - An excellent input method switcher that provided valuable reference
- Swift and SwiftUI community
- All contributors and users who provided feedback
🇺🇸 English | 📦 安装方法 | 📖 使用说明
TypeSwitch 是一个基于 SwiftUI 开发的现代 macOS 应用,用于自动切换不同应用的输入法。采用新的 Swift 特性和原生 macOS 功能,为用户提供流畅高效的输入法管理体验。
- 🔄 自动切换:在切换应用时自动切换到预设的输入法
- 🔍 快速搜索:支持模糊搜索应用程序
- 🎯 精确匹配:为每个应用设置独立的输入法偏好
- 🚀 开机启动:支持开机自动启动
- ⌨️ 快捷键支持:
⌘ + F
- 快速搜索应用⌘ + R
- 刷新应用列表⌘ + Q
- 退出应用
- 🎯 快速切换:支持自定义快捷键切换当前应用的默认输入法
- 🖥 macOS 13.0 或更高版本
- 🔐 需要辅助功能权限用于监控应用切换
- ⌨️ 需要输入法切换权限
# 添加 tap
brew tap ygsgdbd/tap
# 安装应用
brew install --cask typeswitch
- 从 Releases 下载最新版本
- 将应用拖入应用程序文件夹
- 首次启动时授予必要系统权限
- 启动后,应用图标会出现在菜单栏
- 点击菜单栏图标打开主界面
- 在列表中找到要配置的应用
- 选择该应用的默认输入法
- 切换到该应用时会自动切换到设定的输入法
TypeSwitch 非常重视用户隐私和安全:
- 🏠 所有数据本地存储,不会上传网络
- 🚫 不收集任何用户信息或使用数据
- 📖 源代码完全开放,欢迎审查
- 🛡️ 使用 Swift 内置的安全特性
- 🔐 权限使用说明:
- 辅助功能:仅用于检测应用切换
- 输入法切换:仅用于切换输入法
- 自动启动:仅用于开机启动
本项目使用以下开源库:
- Defaults (9.0.0) - 用于持久化存储设置
- SwiftUIX (0.1.9) - 提供额外的 SwiftUI 组件
- SwifterSwift (7.0.0) - Swift 原生扩展
- KeyboardShortcuts (2.2.2) - 添加用户自定义全局快捷键
构建工具:
- Tuist - 用于项目生成和管理
- Xcode 15.0+
- Swift 5.9+
- macOS 13.0+
- Tuist
-
安装 Tuist
-
克隆仓库
git clone https://github.com/ygsgdbd/TypeSwitch.git
cd TypeSwitch
- 生成 Xcode 项目
tuist generate
- 打开项目并构建
open TypeSwitch.xcworkspace
本项目使用 GitHub Actions 进行自动构建和发布:
- 推送新的版本标签会触发自动构建:
git tag v1.0.0
git push origin v1.0.0
-
GitHub Actions 会自动:
- 构建应用
- 创建 DMG 安装包
- 发布新版本
- 生成更新日志
-
构建产物可在 Releases 页面下载
TypeSwitch/
├── Project.swift # Tuist 项目配置
├── Tuist/ # Tuist 配置文件
├── Sources/ # 源代码
│ ├── Models/ # 数据模型
│ ├── Views/ # SwiftUI 视图
│ ├── ViewModels/ # 视图模型
│ └── Utils/ # 工具类
└── Tests/ # 测试文件
欢迎提交 Pull Request 和创建 Issue,在提交 PR 之前,请确保:
- 代码符合项目的代码风格
- 添加了必要的测试
- 更新了相关文档
本项目基于 MIT 许可证开源。详见 LICENSE 文件。
本项目受到以下项目和社区的启发和帮助:
- SwitchKey - 一个优秀的输入法切换工具,为本项目提供了宝贵的参考
- Swift 和 SwiftUI 社区
- 所有提供反馈和贡献者和用户