Only cache OS X GPU output
This commit is contained in:
parent
ab09bf9670
commit
53505207eb
1 changed files with 7 additions and 10 deletions
15
neofetch
15
neofetch
|
@ -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"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
Loading…
Reference in a new issue