$ show elParaguayo/qtile-extras
qtile-extras is a third-party extension library for the Qtile tiling window manager, providing a rich collection of custom widgets, layout decorations, popup toolkits, and external service integrations (e.g., Strava, Snapcast, MPRIS2, UPower). It does not run standalone; it is imported by user Qtile configuration files and adds features such as decorative borders, gradient backgrounds, global menus, status notifiers, and interactive popups. The architecture relies on lazy imports, mixin-based widget composition, and monkey-patching of Qtile internals for decoration injection. Many widgets pull data via DBus or HTTP APIs and render it through cairocffi. The codebase is well-structured with extensive tests and documentation, though certain components are experimental or personally maintained.
The LLM identified 4 files worth highlighting for reuse:
Provides `ImgMask` and `Loader` classes for loading SVG icons and applying color masks using cairocffi. This is a self-contained utility that can be reused in any Cairo-based project to generate colored icons from monochrome SVGs. It demonstrates clean abstraction for icon rendering and supports both file paths and raw data inputs.
Implements a mapping from time components (hour, minute) to human-readable phrases for an English word clock. This pattern is replicated for multiple languages (Dutch, Finnish, French, Portuguese, Spanish, Swedish). Each language file is completely isolated and can be extracted into a standalone time-to-words library. The structure is simple and extensible, making it a solid example of i18n-aware feature engineering.
Contains abstract base classes for custom window borders (`_BorderStyle`, `GradientBorder`, `ConditionalBorder`, `CustomBorder`) that leverage Cairo for rendering. The design uses composition and configuration dictionaries, allowing easy creation of new border styles. Although coupled to Qtile's window system via monkey-patching, the rendering logic itself is decoupled and could be adapted for any Cairo-based UI framework.
Provides reusable mixins (`ExtendedPopupMixin`, `TooltipMixin`, `ProgressBarMixin`) that add popup, tooltip, and progress bar functionality to any Qtile widget. These mixins standardize property names and update flows, reducing boilerplate. While dependent on Qtile's base widget class, the mixin pattern itself is clean and demonstrates good object-oriented design for extending UI components.