Linux device manager for Logitech devices
Go to file
Ken Sanislo ba0b45df22
device: Support per-slot unpair on Lightspeed receivers (CLI + GUI) (#3183)
* Add CLI --slot unpair for Lightspeed receivers

Adds Receiver.force_unpair_slot(), a low-level method that writes the
RECEIVER_PAIRING unpair register (action 0x03) for a given slot regardless
of cache state, bypassing may_unpair and re_pairs gates. Intended for
clearing stale pairings on Lightspeed receivers where Solaar cannot read
the slot's pairing info or the device is no longer reachable on RF.

Extends the `solaar unpair` CLI with three new flags:
  --receiver <name>   select which receiver to target
  --slot <N>          target a specific slot number directly
  --dry-run           print what would happen without issuing the write

The --slot path is gated to Lightspeed receivers only (by receiver_kind)
so Unifying/Bolt/Nano behavior is unchanged. It populates the cache first
and prints the current slot contents so the user can confirm what is
about to be cleared, but does not refuse based on active/offline state —
the explicit --slot N is treated as sufficient intent.

Verified end-to-end on a C547 dual-slot Lightspeed receiver: stale slot
cleared, RECEIVER_INFO sub-registers 0x21/0x31 went to None, connection
count register dropped from 2 to 1, running solaar daemon picked up the
change in real time via the existing DJ pairing notification hook.

Covered by 5 unit tests against a mocked Receiver: empty slot, stale
sentinel, active device invalidation, register write failure, closed
handle.

* Enable GUI unpair for Lightspeed receivers

Flip _lightspeed_receiver() to may_unpair: True so the GUI unpair button
becomes sensitive for Lightspeed-paired devices, and route the GUI unpair
action through _unpair_device(n, force=True) so the unpair register write
actually fires instead of short-circuiting to cache invalidation.

The previous GUI path called `del receiver[n]`, which dispatches to
Receiver.__delitem__ → _unpair_device(n, force=False). On receivers with
re_pairs=True (Lightspeed, Nano) that hits the cache-invalidation branch
at receiver.py:391 and never writes the unpair register — a "fake unpair"
that would have left the slot bound on the hardware even after the button
was enabled.

With force=True, the GUI now issues RECEIVER_PAIRING action 0x03 for the
selected slot, matching the CLI unpair path (cli/unpair.py:39) which has
always used force=True. Lightspeed and Unifying unpair behavior are now
symmetric: the button is enabled, the confirmation dialog is shown, and
the register write is performed.

The pair/add flow is untouched: it still uses set_lock(device=0) which
lets the receiver firmware pick an empty slot, re_pairs remains True so
the listener's silent-replace branch continues to handle re-pair into an
occupied devnumber. Verified on dual-slot C547 hardware that pairing into
an empty slot preserves the occupant of the other slot.

Stale pairings where Solaar can't enumerate the slot (no cached device
row to right-click) still require the --slot CLI from the preceding
commit — that path is orthogonal to this GUI enablement.

* Apply suggestion from @pfps

Lightspeed receivers don't appear to re-pair.

---------

Co-authored-by: Peter F. Patel-Schneider <pfpschneider@gmail.com>
2026-04-17 09:34:58 -04:00
.github doc: instructions on running solaar show in 1.1.18 2025-12-21 18:01:53 -05:00
bin Remove Python 2 specific path handling 2025-01-01 10:18:44 -05:00
docs docs: mention Centurion protocol in documentation 2026-04-14 12:31:33 -04:00
lib device: Support per-slot unpair on Lightspeed receivers (CLI + GUI) (#3183) 2026-04-17 09:34:58 -04:00
po add Bulgarian translation 2026-04-07 08:36:02 -04:00
rules.d docs: document change to use uinput only 2026-03-08 20:58:43 -04:00
rules.d-uinput Apply uaccess rules on all actions other than remove 2025-09-08 10:11:52 -04:00
share release 1.1.19 2026-01-08 12:32:44 -05:00
tests device: Support per-slot unpair on Lightspeed receivers (CLI + GUI) (#3183) 2026-04-17 09:34:58 -04:00
tools Add installation guide for Solaar on RHEL 10 (#3158) 2026-03-08 20:54:31 -04:00
.coveragerc Test coverage: Fix keysyms to be visible (#9) 2024-10-11 07:42:38 -04:00
.git-blame-ignore-revs git-blame-ignore-revs: add pre-commit bulk change 2020-07-07 16:10:37 +01:00
.gitignore Ignore macOS junk files and pipenv config 2025-01-02 17:18:39 -05:00
.pre-commit-config.yaml dist: modify pre-commit args to make ruff change files 2024-02-21 16:06:22 -05:00
.python-version dist: update pre-commit versions and python version 2022-11-23 14:20:56 -05:00
CHANGELOG.md release 1.1.19 2026-01-08 12:32:44 -05:00
COPYRIGHT clarify license status; fix debian packaging copyight notice 2019-12-24 18:53:43 +00:00
LICENSE.txt Simplify name of license file 2024-03-02 18:15:56 -05:00
MANIFEST.in Simplify name of license file 2024-03-02 18:15:56 -05:00
Makefile tools: add python3-devel to install-dnf in Makefile 2025-12-20 12:31:17 -05:00
README.md docs: make known issues more prominent 2025-10-23 08:16:05 -04:00
RELEASE.md Rename changelog.md to all capitals 2024-03-02 18:15:56 -05:00
RHEL.md Improve RHEL installation guide and add automated install example (#3162) 2026-03-10 07:43:25 -04:00
Release_Notes.md release: drop testing of Python before 3.13 2025-12-12 04:55:14 -05:00
mkdocs.yml docs: update files shown in documentation 2025-10-23 09:28:52 -04:00
pyproject.toml ruff: Force single line imports 2024-03-13 15:41:21 -04:00
release.sh misc: Use PATH instead of hardcoded absolute paths (#3014) 2025-11-04 03:28:10 +09:00
setup.py Use console_scripts entry point for pipx compatibility 2026-03-07 07:17:54 -05:00

README.md

Solaar

Solaar is a Linux manager for many Logitech keyboards, mice, and other devices that connect wirelessly to a Unifying, Bolt, Lightspeed or Nano receiver as well as many Logitech devices that connect via a USB cable or Bluetooth. Solaar is not a device driver and responds only to special messages from devices that are otherwise ignored by the Linux input system.

More Information - Usage - Capabilities - Rules - Manual Installation - Known Issues

codecov License: GPL v2

 

 

Solaar supports:

  • pairing/unpairing of devices with receivers
  • configuring device settings
  • custom button configuration
  • running rules in response to special messages from devices

For more information see the main Solaar documentation page. -

Installation Packages

Up-to-date prebuilt packages are available for some Linux distros (e.g., Fedora) in their standard repositories. If a recent version of Solaar is not available from the standard repositories for your distribution, you can try one of these packages:

Solaar is available from some other repositories but may be several versions behind the current version: