summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilal Özel <112190455+Shinobu420@users.noreply.github.com>2026-03-09 15:33:33 +0100
committerGitHub <noreply@github.com>2026-03-10 01:33:33 +1100
commit0d56db3b6cd28083f4dfd19815fef2730668a78f (patch)
treebb1260adbe8e24e240936b493fb5ff100a7fe0fd
parentfeat: add Logo shape component (#1247) (diff)
downloadcaelestia-shell-0d56db3b6cd28083f4dfd19815fef2730668a78f.tar.gz
caelestia-shell-0d56db3b6cd28083f4dfd19815fef2730668a78f.tar.bz2
caelestia-shell-0d56db3b6cd28083f4dfd19815fef2730668a78f.zip
systemusage: improve GPU detection for AMD RX series GPU (#1246)
* SystemUsage:improve GPU-Detection for AMD RX series GPU updated the gpuNameDetect command with glxinfo to fix gpu name detection * SystemUsage: adjust lspci command to detect graphics card better * SystemUsage: adjust regex to extract name out of last bracket * clean less * no need xargs --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
-rw-r--r--services/SystemUsage.qml9
1 files changed, 6 insertions, 3 deletions
diff --git a/services/SystemUsage.qml b/services/SystemUsage.qml
index 1144932..ce62017 100644
--- a/services/SystemUsage.qml
+++ b/services/SystemUsage.qml
@@ -49,7 +49,7 @@ Singleton {
}
function cleanGpuName(name: string): string {
- return name.replace(/NVIDIA GeForce /gi, "").replace(/NVIDIA /gi, "").replace(/AMD Radeon /gi, "").replace(/AMD /gi, "").replace(/Intel /gi, "").replace(/\(R\)/gi, "").replace(/\(TM\)/gi, "").replace(/Graphics/gi, "").replace(/\s+/g, " ").trim();
+ return name.replace(/\(R\)/gi, "").replace(/\(TM\)/gi, "").replace(/Graphics/gi, "").replace(/\s+/g, " ").trim();
}
function formatKib(kib: real): var {
@@ -232,7 +232,7 @@ Singleton {
id: gpuNameDetect
running: true
- command: ["sh", "-c", "nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null || lspci 2>/dev/null | grep -i 'vga\\|3d\\|display' | head -1"]
+ command: ["sh", "-c", "nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null || glxinfo -B 2>/dev/null | grep 'Device:' | cut -d':' -f2 | cut -d'(' -f1 || lspci 2>/dev/null | grep -i 'vga\\|3d controller\\|display' | head -1"]
stdout: StdioCollector {
onStreamFinished: {
const output = text.trim();
@@ -242,9 +242,12 @@ Singleton {
// Check if it's from nvidia-smi (clean GPU name)
if (output.toLowerCase().includes("nvidia") || output.toLowerCase().includes("geforce") || output.toLowerCase().includes("rtx") || output.toLowerCase().includes("gtx")) {
root.gpuName = root.cleanGpuName(output);
+ } else if (output.toLowerCase().includes("rx")) {
+ root.gpuName = root.cleanGpuName(output);
} else {
// Parse lspci output: extract name from brackets or after colon
- const bracketMatch = output.match(/\[([^\]]+)\]/);
+ // Handles cases like [AMD/ATI] Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] (rev c0)
+ const bracketMatch = output.match(/\[([^\]]+)\][^\[]*$/);
if (bracketMatch) {
root.gpuName = root.cleanGpuName(bracketMatch[1]);
} else {