From d8e957cb0d4204d144f964941ec58fae11bbb8e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne?= Date: Sun, 4 Oct 2020 14:05:34 +0200 Subject: [PATCH] Improve glxinfo call, OpenBSD sensors fix (#1494) * Use `glxinfo -B' instead of `glxinfo' It's enough to get the gpu infos and it's way faster. * OpenBSD: fix cpu sensors informations, add ksmn(4) and adt(4) --- neofetch | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 04bb10d5..ae42adbd 100755 --- a/neofetch +++ b/neofetch @@ -2246,8 +2246,7 @@ get_cpu() { ;; "OpenBSD"* | "Bitrig"*) deg="$(sysctl hw.sensors | \ - awk -F '=| degC' '/lm0.temp|cpu0.temp/ {print $2; exit}')" - deg="${deg/00/0}" + awk -F'=|degC' '/(ksmn|adt|lm|cpu)0.temp0/ {printf("%2.1f", $2); exit}')" ;; esac ;; @@ -2529,7 +2528,7 @@ get_gpu() { ;; *) - gpu="$(glxinfo | grep -F 'OpenGL renderer string')" + gpu="$(glxinfo -B | grep -F 'OpenGL renderer string')" gpu="${gpu/OpenGL renderer string: }" ;; esac