Skip to content

froggychips/AutoSwitcher

Repository files navigation

FrogSwitch

FrogSwitch is a lightweight macOS utility that automatically corrects text typed in the wrong keyboard layout and switches the input source.

Features

  • Auto-Correction: Detects and fixes text typed in the wrong layout (e.g., ghbdtn -> привет).
  • Auto-Switching: Automatically switches the system keyboard layout (EN <-> RU).
  • Background Operation: Runs silently in the background with a menu bar icon.
  • Native App: Distributed as a standalone .app.

Usage

  1. Download FrogSwitch.app.
  2. Move it to the Applications folder.
  3. Launch the application.

Note: On the first launch, you must grant Accessibility permissions in System Settings -> Privacy & Security -> Accessibility. This is required to monitor keystrokes and perform corrections.

Building from Source

To build the application from source, you need Python 3 installed.

  1. Clone the repository:

    git clone https://github.com/yourusername/FrogSwitch.git
    cd FrogSwitch
  2. Create and activate a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
  3. Install dependencies:

    pip install pyobjc-framework-Cocoa pyobjc-framework-Quartz pyobjc-framework-Carbon pyinstaller pillow
  4. Build the application:

    # Generate icon
    python3 create_icon.py
    
    # Create .icns (requires macOS tools)
    mkdir FrogSwitch.iconset
    sips -z 16 16     icon.png --out FrogSwitch.iconset/icon_16x16.png
    sips -z 32 32     icon.png --out FrogSwitch.iconset/icon_16x16@2x.png
    sips -z 128 128   icon.png --out FrogSwitch.iconset/icon_128x128.png
    sips -z 256 256   icon.png --out FrogSwitch.iconset/icon_256x256.png
    sips -z 512 512   icon.png --out FrogSwitch.iconset/icon_512x512.png
    iconutil -c icns FrogSwitch.iconset
    
    # Build app
    pyinstaller --onefile --windowed --name FrogSwitch --icon=FrogSwitch.icns --add-data "layout_switcher.py:." autoswitcher.py

    The application will be located in the dist/ directory.