From 353d77c4fb55087769b3ecddeca91108276dc209 Mon Sep 17 00:00:00 2001 From: thomas Date: Thu, 22 Oct 2026 08:17:19 +0100 Subject: [PATCH] Fix: Only set NVIDIA env vars when the NVIDIA driver is loaded, drop duplicate Qt theme var Co-Authored-By: Claude Opus 5.5 --- dotfiles/.config/hypr/core/env.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/dotfiles/.config/hypr/core/env.lua b/dotfiles/.config/hypr/core/env.lua index a22c2e7..e33efd3 100644 --- a/dotfiles/.config/hypr/core/env.lua +++ b/dotfiles/.config/hypr/core/env.lua @@ -19,8 +19,7 @@ hl.env("XDG_SESSION_TYPE", "wayland") -- QT Variables hl.env("QT_AUTO_SCREEN_SCALE_FACTOR", "1") hl.env("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1") -hl.env("QT_QPA_PLATFORMTHEME", "qt5ct") -hl.env("QT_QPA_PLATFORMTHEME", "qt6ct") +hl.env("QT_QPA_PLATFORMTHEME", "qt6ct") -- qt6ct also styles Qt5 apps that read it; qt5ct.conf is kept in sync -- hyprland-qt-support hl.env("QT_QUICK_CONTROLS_STYLE", "org.hyprland.style") @@ -49,13 +48,17 @@ hl.env("MOZ_ENABLE_WAYLAND", "1") hl.env("ELECTRON_OZONE_PLATFORM_HINT", "auto") -- auto selects Wayland if possible, X11 otherwise -- NVIDIA --- This is from the Hyprland wiki. Uncomment below if an nvidia GPU is detected. -- See hyprland wiki https://wiki.hyprland.org/Nvidia/#environment-variables - -hl.env("LIBVA_DRIVER_NAME", "nvidia") -hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia") -hl.env("NVD_BACKEND", "direct") -hl.env("GSK_RENDERER", "ngl") +-- Only when the NVIDIA kernel driver is loaded, so the same config works on the +-- laptop (forcing LIBVA_DRIVER_NAME=nvidia there breaks VA-API video decoding). +local nvidia = io.open("/proc/driver/nvidia/version") +if nvidia then + nvidia:close() + hl.env("LIBVA_DRIVER_NAME", "nvidia") + hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia") + hl.env("NVD_BACKEND", "direct") + hl.env("GSK_RENDERER", "ngl") +end -- additional ENV's for nvidia. Caution, activate with care -- hl.env("GBM_BACKEND", "nvidia-drm")