mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-23 03:59:58 +00:00
Add cache support for CPU
This commit is contained in:
9
neofetch
9
neofetch
@@ -839,8 +839,13 @@ getcpu () {
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
cpu="$(sysctl -n machdep.cpu.brand_string)"
|
if [ -f "/Library/Caches/neofetch/cpu" ]; then
|
||||||
cores=$(sysctl -n hw.ncpu)
|
source "/Library/Caches/neofetch/cpu"
|
||||||
|
else
|
||||||
|
cpu="$(sysctl -n machdep.cpu.brand_string)"
|
||||||
|
cores=$(sysctl -n hw.ncpu)
|
||||||
|
cache "cpu" "$cpu" "/Library/Caches/"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*"BSD" | "Windows")
|
*"BSD" | "Windows")
|
||||||
|
|||||||
Reference in New Issue
Block a user