$ show pwr-Solaar/Solaar
Solaar is a Linux application for managing Logitech wireless peripherals (mice, keyboards, headsets) via Unifying, Bolt, Lightspeed, Nano receivers, USB, or Bluetooth. It provides device pairing/unpairing, battery monitoring, LED/RGB control (including per-key), button remapping, profile management, and rule-based automation for device events. The architecture consists of a core device communication library (logitech_receiver), GTK-based GUI, CLI interface, system tray integration, and DBus support for system events. Settings are persisted in YAML files, and the application maintains device state across reconnections via a persister mechanism. The codebase demonstrates solid engineering practices with modular separation of concerns, internationalization support, and comprehensive test coverage.
The LLM identified 3 files worth highlighting for reuse:
Provides NamedInt and NamedInts classes for creating enumerations with integer values and reverse name lookup. This utility is self-contained, has no internal dependencies, and can be reused in any project needing bidirectional mapping between values and names.
Implements a set of reusable validator classes (Boolean, Choice, Range, etc.) for validating device settings. These validators are used by the settings template system and can be extracted for validating configuration in other applications.
Defines the Layout and Cell dataclasses for representing per-key RGB layouts, and the PerKeyColorSink protocol for setting colors on devices. This data model is independent of the UI toolkit and can be reused for configuring RGB devices.