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)
This commit is contained in:
Charlène 2020-10-04 14:05:34 +02:00 committed by GitHub
parent 60d090164d
commit d8e957cb0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -2246,8 +2246,7 @@ get_cpu() {
;; ;;
"OpenBSD"* | "Bitrig"*) "OpenBSD"* | "Bitrig"*)
deg="$(sysctl hw.sensors | \ deg="$(sysctl hw.sensors | \
awk -F '=| degC' '/lm0.temp|cpu0.temp/ {print $2; exit}')" awk -F'=|degC' '/(ksmn|adt|lm|cpu)0.temp0/ {printf("%2.1f", $2); exit}')"
deg="${deg/00/0}"
;; ;;
esac 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: }" gpu="${gpu/OpenGL renderer string: }"
;; ;;
esac esac