mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-10-04 09:08:38 +00:00
GPU: Only number GPU if more than one exists
This commit is contained in:
5
neofetch
5
neofetch
@@ -968,6 +968,9 @@ get_gpu() {
|
|||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
gpus=($(lspci -mm | awk -F '\\"|\\" \\"' '/"Display|"3D|"VGA/ {print $3 " " $4}'))
|
gpus=($(lspci -mm | awk -F '\\"|\\" \\"' '/"Display|"3D|"VGA/ {print $3 " " $4}'))
|
||||||
|
|
||||||
|
# Number the GPUs if more than one exists.
|
||||||
|
[[ "${#gpus[@]}" > 1 ]] && index=0
|
||||||
|
|
||||||
for gpu in "${gpus[@]}"; do
|
for gpu in "${gpus[@]}"; do
|
||||||
case "$gpu" in
|
case "$gpu" in
|
||||||
*"advanced"*)
|
*"advanced"*)
|
||||||
@@ -1002,7 +1005,7 @@ get_gpu() {
|
|||||||
gpu="${gpu/Intel }"
|
gpu="${gpu/Intel }"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
prin "GPU${index:-0}" "$gpu"
|
prin "GPU${index}" "$gpu"
|
||||||
index="$((index+=1))"
|
index="$((index+=1))"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user