瀏覽代碼

Improve GPU Reading on Linux (#1916)

GPUs that have subsystem name but no revision number can be processed
correctly by using $(NF-1) instead of $7 in the awk
gitfib 3 年之前
父節點
當前提交
4b91c94360
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      neofetch

+ 1 - 1
neofetch

@@ -2491,7 +2491,7 @@ get_gpu() {
             gpu_cmd="$(lspci -mm |
                        awk -F '\"|\" \"|\\(' \
                               '/"Display|"3D|"VGA/ {
-                                  a[$0] = $1 " " $3 " " ($7 ~ /^$|^Device [[:xdigit:]]+$/ ? $4 : $7)
+                                  a[$0] = $1 " " $3 " " ($(NF-1) ~ /^$|^Device [[:xdigit:]]+$/ ? $4 : $(NF-1))
                               }
                               END { for (i in a) {
                                   if (!seen[a[i]]++) {