Move NVIDIA env setup to Hyprland Lua
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.
This commit is contained in:
@@ -6,6 +6,21 @@ local function shell_quote(value)
|
||||
return "'" .. tostring(value):gsub("'", "'\\''") .. "'"
|
||||
end
|
||||
|
||||
o.shell_quote = shell_quote
|
||||
|
||||
function o.shell_succeeds(command)
|
||||
local ok, _, code = os.execute(command .. " >/dev/null 2>&1")
|
||||
return ok == true or ok == 0 or code == 0
|
||||
end
|
||||
|
||||
function o.cmd_present(command)
|
||||
return o.shell_succeeds("command -v " .. shell_quote(command))
|
||||
end
|
||||
|
||||
function o.cmd_missing(command)
|
||||
return not o.cmd_present(command)
|
||||
end
|
||||
|
||||
local function command_from(value, description)
|
||||
if type(value) ~= "table" then
|
||||
return value
|
||||
|
||||
Reference in New Issue
Block a user