[PR] dylanaraps/neofetch#1131 from xudong-yang - fix GPU driver detection bug with bumblebee-managed dual video cards

Upstream PR: https://github.com/dylanaraps/neofetch/pull/1131
Thanks to @xudong-yang

Co-authored-by: xudong-yang <xudong.yang@ucl.ac.uk>
This commit is contained in:
Azalea (on HyDEV-Daisy) 2022-08-11 20:34:18 -04:00
commit 2850674070

View file

@ -4416,7 +4416,7 @@ get_gpu_driver() {
case $os in
"Linux")
gpu_driver="$(lspci -nnk | awk -F ': ' \
'/Display|3D|VGA/{nr[NR+2]}; NR in nr {printf $2 ", "; exit}')"
'/Display|3D|VGA/{nr[NR+2]}; NR in nr && $1~"nel driv" {printf $2 ", "}')"
gpu_driver="${gpu_driver%, }"
if [[ "$gpu_driver" == *"nvidia"* ]]; then