Skip to content

Commit

Permalink
[PR] dylanaraps/neofetch#1928 from theofficialgman - get gpu name for…
Browse files Browse the repository at this point in the history
… linux systems without pcie gpus

Upstream PR: dylanaraps/neofetch#1928
Thanks to @theofficialgman

Co-authored-by: theofficialgman <[email protected]>
  • Loading branch information
hykilpikonna and theofficialgman committed Jul 31, 2022
2 parents 541874f + 4972519 commit 28dcc8a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -2695,6 +2695,12 @@ get_gpu() {
print a[i]
}
}}')"

if [[ "$gpu_cmd" == "" ]]; then
gpu_cmd="$(glxinfo -B | grep -F 'OpenGL renderer string')"
gpu_cmd="${gpu_cmd/OpenGL renderer string: }"
fi

IFS=$'\n' read -d "" -ra gpus <<< "$gpu_cmd"

# Remove duplicate Intel Graphics outputs.
Expand Down Expand Up @@ -2728,6 +2734,7 @@ get_gpu() {
;;

*"NVIDIA"*)
gpu="${gpu/*NVIDIA}"
gpu="${gpu/*\[}"
gpu="${gpu/\]*}"
gpu="NVIDIA $gpu"
Expand Down

0 comments on commit 28dcc8a

Please sign in to comment.