Refactor GPU
This commit is contained in:
parent
ab1de702f9
commit
cc9095ccd5
1 changed files with 4 additions and 4 deletions
8
neofetch
8
neofetch
|
@ -987,12 +987,12 @@ getcpu_usage() {
|
||||||
getgpu() {
|
getgpu() {
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux")
|
"Linux")
|
||||||
gpu="$(PATH="/sbin:$PATH" lspci | grep -F "3D")"
|
gpu="$(PATH="/sbin:$PATH" lspci -mm | awk -F '\\"|\\" \\"' '/3D|VGA/ {print $3 " " $4}')"
|
||||||
|
|
||||||
# If a GPU with a prefix of '3D' doesn't exist
|
# If a GPU with a prefix of '3D' doesn't exist
|
||||||
# fallback to looking for a prefix of 'VGA'
|
# fallback to looking for a prefix of 'VGA'
|
||||||
[ -z "$gpu" ] && \
|
# [ -z "$gpu" ] && \
|
||||||
gpu="$(PATH="/sbin:$PATH" lspci | grep -F "VGA")"
|
# gpu="$(PATH="/sbin:$PATH" lspci | grep -F "VGA")"
|
||||||
|
|
||||||
gpu="${gpu//??':'??'.'?}"
|
gpu="${gpu//??':'??'.'?}"
|
||||||
|
|
||||||
|
@ -2427,7 +2427,7 @@ info() {
|
||||||
eval output="\$${1}"
|
eval output="\$${1}"
|
||||||
|
|
||||||
else
|
else
|
||||||
"get$2" 2>/dev/null
|
time "get$2" 2>/dev/null
|
||||||
eval output="\$${2}"
|
eval output="\$${2}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue