mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-10-04 01:00:17 +00:00
gpu: Correctly filter out duplicates
This commit is contained in:
4
neofetch
4
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.
|
||||
|
Reference in New Issue
Block a user