AMD graphics card name was not being parsed correctly from lspci

This commit is contained in:
mgrotke 2025-01-28 17:15:53 -05:00
parent f8b3fda0b5
commit 9238875364

View file

@ -51,7 +51,7 @@ function conky_get_cpu_info()
end end
end end
-- ########################################################## GET GU MAKE AND MODEL ########################################################### -- ########################################################## GET GPU MAKE AND MODEL ##########################################################
function conky_shorten_gpu_name(gpu_name) function conky_shorten_gpu_name(gpu_name)
return (gpu_name return (gpu_name
@ -73,10 +73,14 @@ function conky_shorten_gpu_name(gpu_name)
:gsub("Raspberry Pi Foundation", "Raspberry Pi") :gsub("Raspberry Pi Foundation", "Raspberry Pi")
:gsub("Broadcom Inc%.", "Broadcom") :gsub("Broadcom Inc%.", "Broadcom")
:gsub("Lite Hash Rate", "LHR") :gsub("Lite Hash Rate", "LHR")
:gsub("Renoir", "") -- Remove "Renoir"
:gsub("Ryzen %d+/%d+ Mobile Series", "") -- Remove Ryzen details (for APUs)
:gsub("%(Ryzen.-%)", "") -- Remove Ryzen-related info in parentheses
:gsub("GA%d+%s%[", "") -- Remove chip identifier like "GA106 [" :gsub("GA%d+%s%[", "") -- Remove chip identifier like "GA106 ["
:gsub("%].*", "") -- Remove everything after "]" :gsub("%[.*%]%s*", "") -- Remove chip code in brackets like "[1002:1636]"
:gsub("%(.*%)", "") -- Remove revision info like "(rev a1)" :gsub("%((rev .-)%)", "") -- Remove revision info like "(rev a1)"
:gsub("%s+", " ") -- Normalize spaces :gsub("%s+", " ") -- Normalize spaces
:gsub("%]%s*$", "") -- Remove trailing square bracket "]" if it exists
:match("^%s*(.-)%s*$") -- Trim leading/trailing spaces :match("^%s*(.-)%s*$") -- Trim leading/trailing spaces
) )
end end