From 08276bde5eae3ecf8eb396fa548e3726b170dedc Mon Sep 17 00:00:00 2001 From: SomaUlte Date: Mon, 23 Jan 2017 04:01:50 -0500 Subject: [PATCH 1/3] Update neofetch --- neofetch | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 6553c9d3..06ee2a49 100755 --- a/neofetch +++ b/neofetch @@ -1075,7 +1075,11 @@ get_gpu() { ;; *"intel"*) - gpu="Intel Integrated Graphics" + if [[ $(glxinfo | grep 'OpenGL renderer string: Mesa' | sed 's/ renderer.*//') = "OpenGL" ]]; then + gpu="$(DRI_PRIME=1 glxinfo | grep 'OpenGL renderer' | sed '0,/^.*Intel/ s//Intel/' | sed 's/(R)//' | sed 's/\(\.* (\).*//')" + else + gpu="Intel Integrated Graphics" + fi ;; *"virtualbox"*) From 0dff1213906f73106b8bccd4b0c4bce08f303420 Mon Sep 17 00:00:00 2001 From: SomaUlte Date: Mon, 23 Jan 2017 04:34:13 -0500 Subject: [PATCH 2/3] apply dylanaraps' changes --- neofetch | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/neofetch b/neofetch index 06ee2a49..a39804be 100755 --- a/neofetch +++ b/neofetch @@ -1075,11 +1075,12 @@ get_gpu() { ;; *"intel"*) - if [[ $(glxinfo | grep 'OpenGL renderer string: Mesa' | sed 's/ renderer.*//') = "OpenGL" ]]; then - gpu="$(DRI_PRIME=1 glxinfo | grep 'OpenGL renderer' | sed '0,/^.*Intel/ s//Intel/' | sed 's/(R)//' | sed 's/\(\.* (\).*//')" - else - gpu="Intel Integrated Graphics" - fi + gpu="$(glxinfo | grep -F "Device:")" + gpu="${gpu/*Intel/Intel}" + gpu="${gpu/'(R)'}" + gpu="${gpu/ \(*}" + + [[ -z "$(trim "$gpu")" ]] && gpu="Intel Integrated Graphics" ;; *"virtualbox"*) From c8cce9acb50d19001d6cb451689d5531b44fc1f5 Mon Sep 17 00:00:00 2001 From: SomaUlte Date: Mon, 23 Jan 2017 04:37:03 -0500 Subject: [PATCH 3/3] check for "Intel" in glxinfo grep --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index a39804be..6f68d4ac 100755 --- a/neofetch +++ b/neofetch @@ -1075,7 +1075,7 @@ get_gpu() { ;; *"intel"*) - gpu="$(glxinfo | grep -F "Device:")" + gpu="$(glxinfo | grep "Device:.*Intel")" gpu="${gpu/*Intel/Intel}" gpu="${gpu/'(R)'}" gpu="${gpu/ \(*}"