Bladeren bron

[PR] dylanaraps/neofetch#1928 from theofficialgman - get gpu name for linux systems without pcie gpus

Upstream PR: https://github.com/dylanaraps/neofetch/pull/1928
Thanks to @theofficialgman

Co-authored-by: theofficialgman <28281419+theofficialgman@users.noreply.github.com>
Azalea (on HyDEV-Daisy) 2 jaren geleden
bovenliggende
commit
28dcc8af33
1 gewijzigde bestanden met toevoegingen van 7 en 0 verwijderingen
  1. 7 0
      neofetch

+ 7 - 0
neofetch

@@ -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.
@@ -2728,6 +2734,7 @@ get_gpu() {
                     ;;
 
                     *"NVIDIA"*)
+                        gpu="${gpu/*NVIDIA}"
                         gpu="${gpu/*\[}"
                         gpu="${gpu/\]*}"
                         gpu="NVIDIA $gpu"