Skip to content

Edwiv/AutoSwitch

Repository files navigation

AutoSwitch

AutoSwitch is a macOS menu bar app written in Swift. It watches the frontmost app and immediately switches to the input source configured for that app.

Features

  • Event-driven foreground app detection through NSWorkspace.didActivateApplicationNotification
  • Direct input source switching through macOS Text Input Source Services (TISSelectInputSource)
  • Per-app input source rules with a default fallback input source
  • Nested helper apps inherit the outer app's rule, so helper windows such as meeting companions do not become separate rules
  • App icons in the settings sidebar and packaged macOS app icon
  • Menu bar status panel and a SwiftUI settings window
  • Launch-at-login support through a user LaunchAgent
  • Internal Sparkle updates through https://edwiv.byted.org/macapps
  • Local self-test runner that does not require XCTest or full Xcode

Build

swift build

Run

swift run AutoSwitch

The app appears in the menu bar. Open settings from the menu bar item, add or select an app, and choose the input source it should use.

Internal Install And Updates

On another internal Mac, install once with:

curl -fsSL https://edwiv.byted.org/macapps/certs/install-trust.sh | bash
curl -fsSL https://edwiv.byted.org/macapps/apps/autoswitch/install.sh | bash

See Internal Mac Distribution for first-install, verification, troubleshooting, and publish steps.

Package as a macOS app

scripts/package_app.sh release

The packaged app is written to:

dist/AutoSwitch.app

Test

swift run AutoSwitchSelfTests

The self-tests cover rule matching, default fallback behavior, duplicate-switch avoidance, disabled mode, error reporting, settings persistence, LaunchAgent generation/removal, and a burst activation test that verifies the engine has no artificial debounce or sleep delay.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors