From e7168245e1dc263483f7c8bffa6b88f7b7149d73 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 1 Aug 2017 21:25:07 +1000 Subject: [PATCH] gpu: Correctly filter out duplicates --- neofetch | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index d627a4c4..ec3001b5 100755 --- a/neofetch +++ b/neofetch @@ -1113,7 +1113,9 @@ get_gpu() { "Linux") # Read GPUs into array. IFS=$'\n' - gpus=($(lspci -mm | awk -F '\\"|\\" \\"|\\(' '/"Display|"3D|"VGA/ {print $3 " " $4}' | uniq)) + gpus=($(lspci -mm | awk -F '\\"|\\" \\"|\\(' \ + '/"Display|"3D|"VGA/ {a[$0] = $3 " " $4} END{for(i in a) + {if(!seen[a[i]]++) print a[i]}}')) IFS="$old_ifs" # Number the GPUs if more than one exists.