diff --git a/neofetch b/neofetch index 28900c8f..f93e1fea 100755 --- a/neofetch +++ b/neofetch @@ -2449,9 +2449,17 @@ get_gpu() { case $os in "Linux") # Read GPUs into array. - gpu_cmd="$(lspci -mm | awk -F '\"|\" \"|\\(' \ - '/"Display|"3D|"VGA/ {a[$0] = $1 " " $3 " " $4} - END {for(i in a) {if(!seen[a[i]]++) print a[i]}}')" + gpu_cmd="$(lspci -mm | + awk -F '\"|\" \"|\\(' \ + '/"Display|"3D|"VGA/ { + a[$0] = $1 " " $3 " " ($7 ~ /^$|^Device [[:xdigit:]]+$/ ? $4 : $7) + } + END { for (i in a) { + if (!seen[a[i]]++) { + sub("^[^ ]+ ", "", a[i]); + print a[i] + } + }}')" IFS=$'\n' read -d "" -ra gpus <<< "$gpu_cmd" # Remove duplicate Intel Graphics outputs.