From ab4edd42cf635888c9bf4e33ccf68778f5ed9e13 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 22 Dec 2016 13:19:25 +1100 Subject: [PATCH] GPU: Count from 1, Add $gpu_show to change which GPUs are displayed --- neofetch | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index f9da4be2..cfcc2b29 100755 --- a/neofetch +++ b/neofetch @@ -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]' }"