Merge pull request #795 from dylanaraps/702-fix
gpu: Hide duplicate identical gpus
This commit is contained in:
commit
bb5aa97207
1 changed files with 3 additions and 1 deletions
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}'))
|
||||
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.
|
||||
|
|
Loading…
Reference in a new issue