How ilya-zlobintsev/lact works
Main Components
• Daemon (lact-daemon): Acts as the central service that runs as a systemd service (and/or via OpenRC) and directly interacts with the Linux system interfaces (SysFS, libdrm, kernel drivers) for GPU configuration. It reads a configuration file (e.g. /etc/lact/config.yaml) and listens on a Unix socket and optionally a TCP port.
• GUI Client (lact-gui): Provides the graphical user interface (using GTK4 and optionally libadwaita) to allow users to view GPU stats, adjust overclocking settings, control fan curves, etc.
• CLI Utility (lact & lact-cli): Offers a command-line interface to query or change settings, often for scripting or remote access.
• Client Library (lact-client): Abstracts the communication layer between clients (GUI/CLI) and the daemon by encapsulating the details of exchanging messages.
• Shared Schema (lact-schema): Contains common API definitions, types (request/response formats), and serialization logic used by both the daemon and client libraries to maintain consistency.
• Packaging/Deployment Module (pkg directory): Contains build scripts (Makefile), Dockerfiles, Fedora spec files, and packaging recipes—highlighting that the application is designed to be distributed across various Linux distributions.
Relationships and Interactions
• The daemon itself performs hardware interactions using system libraries (libdrm, hwdata) by reading SysFS and issuing commands to enable/control features. This direct link with underlying Linux system interfaces is a critical design aspect.
• The packaging components (scripts, spec files, Dockerfiles) are used to build and distribute the application and can be represented as a separate module that “feeds into” all of these deployed artifacts.
Architectural Patterns and Design Principles
• Separation of Concerns: The user interface (lact-gui) is completely decoupled from the GPU control logic that resides in the daemon. Likewise, the lact-schema and lact-client encapsulate the communication protocol, reducing tight coupling.
• Extensibility: The file structure and modular design make it evident that new features (or support for additional GPUs) may be added by extending the existing libraries or client modules.
Relevant Technologies and Frameworks
• Rust programming language with Cargo for dependency management.
• GTK4 (and libadwaita in lact-gui) for the graphical interface.
• Systemd for service management (as referenced by the usage instructions in the README).
• Linux system interfaces (SysFS, libdrm, kernel drivers) for GPU control.
• Dockerfiles and packaging recipes for multi-distro support.