From 7c6fcb789fd20ebaf689d0985338a451a771a85c Mon Sep 17 00:00:00 2001 From: Dylan Date: Wed, 30 Mar 2016 19:39:03 +1100 Subject: [PATCH] Add cache support for CPU --- neofetch | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index b263fc20..0590c248 100755 --- a/neofetch +++ b/neofetch @@ -839,8 +839,13 @@ getcpu () { ;; "Mac OS X") - cpu="$(sysctl -n machdep.cpu.brand_string)" - cores=$(sysctl -n hw.ncpu) + if [ -f "/Library/Caches/neofetch/cpu" ]; then + 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")