Skip to content

gochev/MacLanguageSwitcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Language Switcher for macOS

A lightweight macOS menu bar application that allows you to switch input languages using CMD+SHIFT only, without needing to press the Space key.

Features

  • 🌐 Switch input languages with just CMD+SHIFT
  • 🎯 Lives in your menu bar - no dock icon
  • ⚑ Lightweight and fast
  • πŸ”’ Privacy-focused - runs locally, no network access
  • βœ… Enable/disable functionality from menu bar

How It Works

macOS doesn't natively support CMD+SHIFT alone for language switching. This app monitors for the CMD+SHIFT key combination and automatically sends CMD+SHIFT+SPACE to trigger the language switch.

Requirements

  • macOS 13.0 (Ventura) or later
  • Xcode 15.0 or later (for building from source)

Prerequisites

Before installing the app, you need to configure macOS to use CMD+SHIFT+SPACE for language switching:

  1. Go to System Settings > Keyboard > Keyboard Shortcuts > Input Sources
  2. Make sure both shortcuts are enabled:
    • βœ… "Select the previous input source" β†’ βŒƒβŒ₯↓ (Control+Option+Down)
    • βœ… "Select next source in Input menu" β†’ βŒƒβŒ₯Space (Control+Option+Space)

Keyboard Shortcut Settings

Note: The app will intercept CMD+SHIFT and automatically send CMD+SHIFT+SPACE to trigger the language switch.

Installation

Quick Install (Recommended)

make install

This will build and install the app to ~/Applications. Then just:

  • Open Spotlight (CMD+Space) and search for "LanguageSwitcher"
  • Or run: open ~/Applications/LanguageSwitcher.app

Development Mode

make run

This builds and runs the app directly.

Post-Installation Steps

  1. Grant Accessibility Permissions:

    • When you first run the app, it will request accessibility permissions
    • Go to System Settings > Privacy & Security > Accessibility
    • Enable the checkbox next to "LanguageSwitcher"
    • Restart the app after granting permissions: make run
  2. Verify the Menu Bar Icon:

    • Look for the 🌐 globe icon in your menu bar
    • Click it to see the menu

    Menu Bar Icon

  3. Optional - Start on Login:

    • System Settings > General > Login Items
    • Click the "+" button and add Language Switcher

Other Make Commands

make build    # Just build, don't run
make clean    # Clean build artifacts
make help     # Show all commands

Usage

  1. Launch the app - A 🌐 globe icon will appear in your menu bar
  2. Press CMD+SHIFT to switch languages (the app sends CMD+SHIFT+SPACE automatically)
  3. Click the menu bar icon to:
    • View status
    • Quit the app

Troubleshooting

Language switching doesn't work

  1. Check Accessibility Permissions:

    • System Settings > Privacy & Security > Accessibility
    • Make sure LanguageSwitcher is enabled
  2. Verify macOS keyboard shortcut:

    • System Settings > Keyboard > Keyboard Shortcuts > Input Sources
    • Ensure "Select the previous input source" is set to CMD+SHIFT+SPACE
  3. Restart the app:

    • Click the menu bar icon and select "Quit"
    • Launch the app again

The app doesn't appear in the menu bar

  • The app runs as a menu bar-only application (no dock icon)
  • Look for a globe icon in your menu bar
  • If you don't see it, the app may not be running

Permission denied errors

  • Make sure you've granted Accessibility permissions in System Settings
  • You may need to remove and re-add the app in Accessibility settings

Technical Details

Architecture

  • AppDelegate.swift: Main application controller, manages menu bar item
  • KeyboardMonitor.swift: Monitors global keyboard events and triggers language switch
  • Uses NSEvent.addGlobalMonitorForEvents for keyboard monitoring
  • Uses CGEvent to simulate CMD+SHIFT+SPACE keypress

Privacy & Security

  • The app only monitors modifier key states (CMD and SHIFT)
  • No keystroke logging or data collection
  • No network access
  • Runs entirely locally on your Mac
  • App Sandbox is disabled to allow global keyboard monitoring (required for this functionality)

Permissions Required

  • Accessibility: Required to monitor global keyboard events and simulate keypresses

Customization

Change the debounce interval

Edit KeyboardMonitor.swift and modify the debounceInterval value (default: 0.3 seconds):

private let debounceInterval: TimeInterval = 0.3

Change the menu bar icon

Replace the SF Symbol in AppDelegate.swift:

button.image = NSImage(systemSymbolName: "globe", accessibilityDescription: "Language Switcher")

Known Limitations

  • Requires Accessibility permissions (this is a macOS security requirement for global keyboard monitoring)
  • Only works when the app is running
  • Depends on macOS's native CMD+SHIFT+SPACE shortcut being configured

Uninstallation

  1. Quit the app from the menu bar
  2. Remove from Login Items if you added it
  3. Delete the app from Applications folder
  4. Remove Accessibility permissions:
    • System Settings > Privacy & Security > Accessibility
    • Remove LanguageSwitcher from the list

License

MIT License - see LICENSE file for details.

Contributing

Feel free to submit issues or pull requests if you have suggestions for improvements!

Support

If you encounter any issues, please check the Troubleshooting section above or open an issue on GitHub.

About

Switch macos input languages with CMD+SHIFT instead of CMD+SHIFT+SPACE

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors