Only cache OS X GPU output

This commit is contained in:
Dylan 2016-03-30 14:13:40 +11:00
parent ab09bf9670
commit 53505207eb

View file

@ -949,12 +949,6 @@ getcpu () {
# GPU {{{ # GPU {{{
getgpu () { getgpu () {
# Use cache if it exists
if [ -f "/tmp/neofetch/gpu" ]; then
source "/tmp/neofetch/gpu"
return
fi
case "$os" in case "$os" in
"Linux") "Linux")
gpu="$(PATH="/sbin:$PATH" lspci | grep -F "3D")" gpu="$(PATH="/sbin:$PATH" lspci | grep -F "3D")"
@ -1027,7 +1021,13 @@ getgpu () {
;; ;;
"Mac OS X") "Mac OS X")
# Use cache if it exists
if [ -f "/tmp/neofetch/gpu" ]; then
source "/tmp/neofetch/gpu"
else
gpu=$(system_profiler SPDisplaysDataType | awk -F': ' '/^\ *Chipset Model:/ {printf $2 ", "}') gpu=$(system_profiler SPDisplaysDataType | awk -F': ' '/^\ *Chipset Model:/ {printf $2 ", "}')
cache "gpu" "$gpu"
fi
gpu=${gpu//'/ $'} gpu=${gpu//'/ $'}
gpu=${gpu%,*} gpu=${gpu%,*}
;; ;;
@ -1075,9 +1075,6 @@ getgpu () {
gpu=${gpu//+( )/ } gpu=${gpu//+( )/ }
gpu="${gpu}${count}" gpu="${gpu}${count}"
# Cache the output
cache "gpu" "$gpu"
} }
# }}} # }}}