$ show bayasdev/envycontrol
EnvyControl is a monolithic Python CLI tool that configures Linux systems for Nvidia Optimus GPU switching between integrated, hybrid (PRIME offload with RTD3), and nvidia-only modes. It directly writes system configuration files (Xorg, modprobe, udev, display manager scripts), runs system commands, and rebuilds initramfs. All logic resides in a single 500+ line script with no modularity, no tests, and no external Python dependencies beyond the standard library. The code is functional but shows signs of organic growth (e.g., hardcoded paths, global constants, mixed concerns in one function). It is widely used (1893 stars) but the original author has stepped back, seeking a new maintainer. The recent commit and open issue count suggest some community maintenance.
The LLM identified 1 files worth highlighting for reuse:
The `CachedConfig` class implements a lightweight caching adapter that stores the Nvidia GPU PCI bus ID to a JSON file, enabling transitions directly from integrated to nvidia mode without requiring hybrid mode first. While tightly coupled to the script's global state and `get_nvidia_gpu_pci_bus` function rebinding, the pattern of caching runtime-detected hardware information for future use is a pragmatic solution to a real problem. It is not directly extractable but demonstrates a useful technique for similar hardware configuration tools.