mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-02 12:47:49 +02:00
Evaluate NVIDIA session env vars from default/hypr/nvidia.lua during Hyprland startup instead of appending them to each user's envs.lua during setup. This removes the per-user NVIDIA setup script execution while preserving the GSP/non-GSP detection.
16 lines
595 B
Lua
16 lines
595 B
Lua
local paths = require("default.hypr.paths")
|
|
|
|
local nvidia_gsp = paths.omarchy_path .. "/bin/omarchy-hw-nvidia-gsp"
|
|
local nvidia_without_gsp = paths.omarchy_path .. "/bin/omarchy-hw-nvidia-without-gsp"
|
|
|
|
if o.shell_succeeds("lspci | grep -qi nvidia") then
|
|
if o.shell_succeeds(o.shell_quote(nvidia_gsp)) then
|
|
hl.env("NVD_BACKEND", "direct")
|
|
hl.env("LIBVA_DRIVER_NAME", "nvidia")
|
|
hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
|
|
elseif o.shell_succeeds(o.shell_quote(nvidia_without_gsp)) then
|
|
hl.env("NVD_BACKEND", "egl")
|
|
hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
|
|
end
|
|
end
|