Cache GPU output
This commit is contained in:
parent
b2d17711f9
commit
4e7955bc94
6
neofetch
6
neofetch
|
@ -987,6 +987,10 @@ getcpu_usage() {
|
||||||
getgpu() {
|
getgpu() {
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux")
|
"Linux")
|
||||||
|
# Use cache if it exists
|
||||||
|
if [ -f "/tmp/neofetch/gpu" ]; then
|
||||||
|
source "/tmp/neofetch/gpu"
|
||||||
|
else
|
||||||
gpu="$(PATH="/sbin:$PATH" lspci -mm | awk -F '\\"|\\" \\"' '/3D|VGA/ {print $3 " " $4}')"
|
gpu="$(PATH="/sbin:$PATH" lspci -mm | awk -F '\\"|\\" \\"' '/3D|VGA/ {print $3 " " $4}')"
|
||||||
|
|
||||||
case "$gpu" in
|
case "$gpu" in
|
||||||
|
@ -1010,6 +1014,8 @@ getgpu() {
|
||||||
gpu="VirtualBox Graphics Adapter"
|
gpu="VirtualBox Graphics Adapter"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
cache "gpu" "$gpu" "/tmp"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
|
|
Reference in New Issue