GPU: Count from 1, Add $gpu_show to change which GPUs are displayed

This commit is contained in:
Dylan Araps 2016-12-22 13:19:25 +11:00
parent 37d3b9f9a4
commit ab4edd42cf
1 changed files with 6 additions and 1 deletions

View File

@ -969,9 +969,14 @@ get_gpu() {
gpus=($(lspci -mm | awk -F '\\"|\\" \\"' '/"Display|"3D|"VGA/ {print $3 " " $4}'))
# Number the GPUs if more than one exists.
(( "${#gpus[@]}" > 1 )) && gpu_num=0
(( "${#gpus[@]}" > 1 )) && gpu_num=1
for gpu in "${gpus[@]}"; do
# GPU shorthand tests.
[[ "$gpu_show" == "dedicated" && "$gpu" =~ (i|I)ntel ]] || \
[[ "$gpu_show" == "integrated" && ! "$gpu" =~ (i|I)ntel ]] && \
{ unset -v gpu; continue; }
case "$gpu" in
*"advanced"*)
gpu="${gpu/'[AMD/ATI]' }"