From 8ce6cee20ecd0731e0e8f75383fbb0b9285027db Mon Sep 17 00:00:00 2001 From: dylan araps Date: Tue, 5 Jan 2016 18:27:02 +1100 Subject: [PATCH] Cpu speed is still bugged. --- fetch.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fetch.sh b/fetch.sh index 483a7c13..6a5acf84 100755 --- a/fetch.sh +++ b/fetch.sh @@ -472,10 +472,20 @@ getcpu () { "Windows") # Get cpu name - cpu="$(grep 'model name' /proc/cpuinfo)" + cpu="$(grep 'model name' /proc/cpuinfo) @ 4.2GHz" cpu=${cpu/model name*: /} cpu=${cpu// /} cpu=${cpu% } + cpu=${cpu/@*/} + + speed=$(grep 'cpu MHz' /proc/cpuinfo) + speed=${speed/cpu MHz*: /} + speed=${speed/\./} + + # Convert mhz to ghz without bc + speed=$((${speed} / 100000)) + speed=${speed:0:1}.${speed:1} + cpu="$cpu @ ${speed}GHz" ;; *)