CleverSwitch
A CLI tool to synchronize host switching across multiple Logitech devices.
Install / Use
/learn @MikalaiBarysevich/CleverSwitchREADME
CleverSwitch
A small, headless, cross-platform daemon that synchronizes host switching between Logitech keyboard and mouse. When you press the Easy-Switch button on the keyboard, CleverSwitch detects it and immediately sends the same host-switch command to the mouse — so both devices land on the same host simultaneously.
- Runs alongside Logi Options+ or Solaar without conflicts*.
- Must be installed on every host you plan to switch from.
- Currently supports connections via Logitech receivers and Bluetooth.
- Tested with
MX KeysandMX Master 3on Linux, macOS, and Windows.
Support the Project
If you find this project useful, consider supporting its development:
- Credit Card: Donate via Boosty
- Crypto:
BTC: 1HXzgmGZHjLMWrQC8pgYvmcm6afD4idqr7USDT (TRC20): TXpJ3MHcSc144npXLuRbU81gJjD8cwAyzP
Limitations
-
Newer keyboards (MX Keys S, MX Keys for Business, etc.): These models do not support Easy-Switch key diversion. CleverSwitch can only switch between 2 paired hosts automatically. For 3-host setups, set
preferred_hostin the config file (seeconfig.example.yaml). -
macOS + Bluetooth: When using Bluetooth-connected devices on macOS, CleverSwitch may not work correctly if Logi Options+ is running at the same time.
-
Reconnection delay: CleverSwitch does not override device firmware. It acts as a forwarder, which means there is a small delay after reconnection. If you switch back immediately after arriving from another host, the devices may not switch together — CleverSwitch needs a moment to set everything up after reconnection.
Installation
macOS
- Clone the repository (or download the sources archive from Releases).
- Open Terminal and navigate to the project folder.
- Run:
chmod +x scripts/mac/setup.sh
./scripts/mac/setup.sh
The setup script will install Homebrew (if needed), Python, hidapi, and CleverSwitch itself. It will also ask whether you want CleverSwitch to start automatically on login.
On first run, macOS will prompt for Input Monitoring permission. If no prompt appears, grant it manually:
- Open System Settings > Privacy & Security > Input Monitoring.
- Click the + button.
- Press Cmd + Shift + G and paste the path to your binary (e.g.,
/your/path/cleverswitch).
Use which cleverswitch to find the path.
Windows
- Download
cleverswitch.zipfrom the Releases page. - Extract the archive.
- Add the location of
cleverswitch.exetoPATH(optional, but preferred). - Run
setup_startup_windows.batif you want the app to start automatically. If step 3 is skipped, the script and executable must be in the same directory.
Linux
- Clone the repository (or download the sources archive from Releases).
- Open a terminal and navigate to the project folder.
- Run:
chmod +x scripts/linux/setup_linux.sh
./scripts/linux/setup_linux.sh
The setup script will check for Python 3 and hidapi, install CleverSwitch, set up udev rules for non-root HID access, and optionally create an autostart entry.
From Sources
Requires Python >=3.10 on PATH.
- Clone the repository.
- Install:
pip install .
- Run:
cleverswitch
Windows note: The hidapi DLL must be downloaded manually and placed in a directory on your PATH.
Linux note: Install udev rules to allow non-root HID access:
sudo cp rules.d/42-cleverswitch.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger
# Unplug and replug the receiver
macOS note: On first run, macOS will prompt for Input Monitoring permission (see macOS section above).
Homebrew
Will be available once the Homebrew formulae criteria are met:
- be known (e.g. GitHub repositories should have >=30 forks, >=30 watchers or >=75 stars)
- be used by someone other than the author
Run on Startup
macOS
Handled by setup_mac.sh during installation. To set up separately:
chmod +x scripts/mac/setup_startup.sh
./scripts/mac/setup_startup.sh
Windows
- Place
setup_startup_windows.batin the same directory ascleverswitch.exe(unless it's already onPATH). - Run
setup_startup_windows.bat.
To verify, open Task Manager and look for cleverswitch.exe in the Details tab.
Linux
Handled by setup_linux.sh during installation. To set up separately, use your distro's autostart mechanism (e.g., GNOME Tweaks, KDE Autostart) or see other methods.
Uninstall
macOS
chmod +x scripts/mac/uninstall.sh
./scripts/mac/uninstall.sh
This stops and removes the launch agent (if configured) and uninstalls the CleverSwitch package.
Linux
chmod +x scripts/linux/uninstall_linux.sh
./scripts/linux/uninstall_linux.sh
This removes the autostart entry, uninstalls the CleverSwitch package, and optionally removes udev rules.
Windows
- Delete the
cleverswitchfolder. - Remove the startup entry: open Task Manager > Startup tab, find
cleverswitch, and disable/delete it.
From Sources
pip uninstall cleverswitch
Configuration
Will be available in later releases.
Hook Scripts
Will be available in later releases.
Relation to Solaar
CleverSwitch is inspired by Solaar and uses the same HID++ 2.0 protocol knowledge, but is an independent, minimal implementation. It does not import or depend on Solaar.
Found a Bug?
Please open a new issue.
Related Skills
node-connect
354.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
