Commit 7069410e authored by Dylan Araps's avatar Dylan Araps

GPU: Only number GPU if more than one exists

parent 32116ea6
......@@ -968,6 +968,9 @@ get_gpu() {
IFS=$'\n'
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
case "$gpu" in
*"advanced"*)
......@@ -1002,7 +1005,7 @@ get_gpu() {
gpu="${gpu/Intel }"
fi
prin "GPU${index:-0}" "$gpu"
prin "GPU${index}" "$gpu"
index="$((index+=1))"
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment