Add nvidia-optimus plugin - #939
Open
joniler wants to merge 2 commits into
Open
Conversation
Monitor and control an NVIDIA Optimus dGPU on Hyprland: toggle Battery (dGPU RTD3-suspends via AQ_DRM_DEVICES + mesa-only EGL) vs HDMI-Ready, with a theme-tinted eye, wake-free sysfs polling, GPU auto-detection, and a live process list.
Contributor
Automatic Code Quality ReviewFile: nvidia-optimus/Panel.qml
+ text: "External display"
+ text: "GPU processes"
+ text: "AQ_DRM_DEVICES is read at session start."
+ text: "Apply now (log out)"File: nvidia-optimus/Settings.qml
+ text: "NVIDIA Optimus"
+ text: "The bar toggle flips Hyprland's AQ_DRM_DEVICES between Battery (iGPU only — the NVIDIA dGPU runtime-suspends, no HDMI) and HDMI-Ready (iGPU + dGPU — external outputs work). It edits ~/.config/hypr/env.conf (backed up alongside) and applies on the next login. The bar icon is theme-tinted: accent when the dGPU is awake, neutral when asleep. Stats poll every 2s from a bundled sysfs-only script that never wakes the GPU; nvidia-smi runs only while this panel is open, and only when the GPU is already awake."
+ text: "Requires: Hyprland (aquamarine), an NVIDIA Optimus laptop with the proprietary driver + nvidia-drm.modeset=1. Override the env file with $HYPR_ENV_FILE if yours lives elsewhere." |
1 similar comment
Contributor
Automatic Code Quality ReviewFile: nvidia-optimus/Panel.qml
+ text: "External display"
+ text: "GPU processes"
+ text: "AQ_DRM_DEVICES is read at session start."
+ text: "Apply now (log out)"File: nvidia-optimus/Settings.qml
+ text: "NVIDIA Optimus"
+ text: "The bar toggle flips Hyprland's AQ_DRM_DEVICES between Battery (iGPU only — the NVIDIA dGPU runtime-suspends, no HDMI) and HDMI-Ready (iGPU + dGPU — external outputs work). It edits ~/.config/hypr/env.conf (backed up alongside) and applies on the next login. The bar icon is theme-tinted: accent when the dGPU is awake, neutral when asleep. Stats poll every 2s from a bundled sysfs-only script that never wakes the GPU; nvidia-smi runs only while this panel is open, and only when the GPU is already awake."
+ text: "Requires: Hyprland (aquamarine), an NVIDIA Optimus laptop with the proprietary driver + nvidia-drm.modeset=1. Override the env file with $HYPR_ENV_FILE if yours lives elsewhere." |
Addresses code-quality review: adds i18n/en.json and replaces hardcoded strings in Panel/Settings/BarWidget with pluginApi?.tr() lookups.
joniler
force-pushed
the
add-nvidia-optimus
branch
from
July 1, 2026 15:32
5ed9fc5 to
b851aff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nvidia-optimus
Monitor and control an NVIDIA Optimus dGPU on Hyprland from the bar. A theme-tinted NVIDIA "eye" shows the dGPU's power state (accent = awake, neutral = asleep); clicking it opens a panel with a Battery ⇄ HDMI-Ready toggle, live power/temp/VRAM, and the list of processes holding the GPU (compute + graphics, including container/root procs that
lsofcan't see).Why: on Hyprland an NVIDIA Optimus dGPU often won't RTD3-suspend even when idle — the compositor's EGL keeps it pinned — quietly draining battery. Meanwhile the HDMI port is frequently wired to the dGPU, so you can't just disable it. This plugin switches between "let the dGPU sleep" (drop it from
AQ_DRM_DEVICES+ force mesa-only EGL) and "HDMI-Ready", and surfaces the true power state at a glance.Notes for review:
bashhelpers underscripts/(run viabash, no exec bit required). They read sysfs /nvidia-smiand edit the user's~/.config/hypr/env.conf(backed up on every change). Both GPUs are auto-detected from sysfs — nothing machine-specific is hardcoded.pci.ids, connectors on a sleeping dGPU are not probed).nvidia-smiruns only while the panel is open, and only when the GPU is already awake.AQ_DRM_DEVICES); requires the proprietary NVIDIA driver +nvidia-drm.modeset=1.asus-um5606-fan-state,battery-and-power-management,arch-updater.Developed at https://github.com/joniler/noctalia-nvidia-optimus