LinuxCommandLibrary

envycontrol

Switch between NVIDIA and integrated graphics

TLDR

Switch between different GPU modes

$ sudo envycontrol [[-s|--switch]] [nvidia|integrated|hybrid]
copy

Specify your [d]isplay [m]anager manually
$ envycontrol --dm [gdm|gdm3|sddm|lightdm]
copy

Check current GPU mode
$ sudo envycontrol [[-q|--query]]
copy

Reset settings
$ sudo envycontrol --reset
copy

Display help
$ envycontrol [[-h|--help]]
copy

Display version
$ envycontrol [[-v|--version]]
copy

SYNOPSIS

envycontrol [-h] [-s {nvidia,nouveau,intel,hybrid}] [-q] [-r] [-l]

PARAMETERS

-h, --help
    Show this help message and exit.

-s {nvidia,nouveau,intel,hybrid}, --switch {nvidia,nouveau,intel,hybrid}
    Switch to the specified graphics driver mode. Requires reboot.

-q, --query
    Query and display the current active graphics driver.

-r, --restore
    Restore the system's original graphics configuration.

-l, --list-drivers
    List all available graphics drivers on the system.

DESCRIPTION

Envycontrol is a lightweight Python script designed for Linux users with NVIDIA Optimus laptops, enabling seamless switching between NVIDIA proprietary drivers, open-source Nouveau, Intel integrated graphics, or hybrid PRIME mode. It automates modifications to kernel parameters in /etc/default/grub and module blacklisting in /etc/modprobe.d/, ensuring the selected driver loads on boot.

Key benefits include power savings with Intel mode for battery life, full NVIDIA performance for gaming/graphics, or hybrid for on-demand NVIDIA rendering via PRIME offload. Unlike complex tools like Optimus Manager, envycontrol is simple, dependency-free (beyond Python3), and distro-agnostic for systemd-based systems with GRUB.

Usage typically requires sudo privileges and a reboot to apply changes. It queries the current mode by checking loaded modules and boot parameters, preserving original configs via backups. Ideal for Arch, Fedora, Ubuntu users avoiding bloatware.

CAVEATS

Requires sudo access and reboot to apply switches. GRUB/systemd-only; test in VM first. Hybrid mode needs PRIME support. Not for Wayland yet in all setups.
Backups created automatically, but verify NVIDIA driver compatibility.

INSTALLATION

Clone from github.com/geminis3/envycontrol, run sudo python3 envycontrol.py, or install via AUR/pacman/pkg.

EXAMPLE USAGE

sudo envycontrol -s hybrid for PRIME offload; envycontrol -q to check mode.

HISTORY

Developed by Erdal (geminis3) in 2021 on GitHub for Arch Linux. Gained popularity for simplicity over bbswitch/Optimus tools. Actively maintained with hybrid PRIME enhancements.

SEE ALSO

Copied to clipboard