Skip to content
/ puck Public

Mac OS X, small shkd like tool for changing input methods. Could assign separate shortcut for each input method, if one shortcut assigned to serveral input methods, then it's cycle thru them.

Notifications You must be signed in to change notification settings

hmepas/puck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Puck Puck - Your Swift Input Method Switching Daemon for macOS

Puck is a lightweight daemon for macOS designed to provide fast and configurable switching between input methods using keyboard shortcuts. Inspired by the simplicity and efficiency of skhd, Puck uses a similar configuration syntax for defining your keybindings.

Features

  • Background Operation: Runs silently as a launchd service.
  • Configurable Hotkeys: Define custom keyboard shortcuts for specific input methods or groups.
  • Input Method Cycling: Assign the same shortcut to multiple input methods to cycle through them.
  • Simple Configuration: Uses an skhd-inspired text file for easy setup.
  • Discoverability: List available input methods and observe key presses directly from the CLI.
  • Autostart: Automatically configures itself to launch on login.
  • Modern macOS: Built with Swift for optimal performance and integration.

CLI Usage

  • puck: Installs and starts the service if not already running.
  • puck -l or puck --list: Lists all available input source IDs configured on the system.
  • puck -o or puck --observe: Enters a mode to observe and print key presses (names and modifiers) to help with configuration.
  • puck -f or puck --foreground: Run in foreground mode without installing as a service.
  • puck -s or puck --status: Show service status (installed and running state).
  • puck -u or puck --uninstall: Uninstall the service.
  • puck -c <path> or puck --config <path>: Use a specific configuration file path.
  • puck -v or puck --version: Show version information.

The default configuration file location is ~/.config/puck/puckrc. You need to create this file before running the service.

Note: The application requires accessibility permissions to function. You will be prompted to grant these permissions in System Settings -> Privacy & Security -> Accessibility when installing the service.

Configuration (~/.config/puck/puckrc)

Puck looks for its configuration file at ~/.config/puck/puckrc by default. The syntax is straightforward:

Define hotkeys using modifier symbols (cmd, ctrl, alt, shift) and key names.

Map a hotkey to a specific input source ID.

Example: Switch to U.S. layout with Cmd+Shift+Space

cmd + shift - space : com.apple.keylayout.US

Example: Cycle between Russian and U.S. using Ctrl+Alt+P

ctrl + alt - p : com.apple.keylayout.Russian ctrl + alt - p : com.apple.keylayout.US

Find input source IDs using 'puck -l'

Find key names using 'puck -o'

Installation

Via Homebrew

brew tap hmepas/puck
brew install puck

Prerequisites

  • macOS
  • Xcode 14.0 or later (will be installed automatically via Homebrew if not present)
  • Accessibility permissions (required for input source switching)

Dependencies

  • Swift Package Manager
  • Xcode Command Line Tools

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

MIT License

About

Mac OS X, small shkd like tool for changing input methods. Could assign separate shortcut for each input method, if one shortcut assigned to serveral input methods, then it's cycle thru them.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages