Added cpu speed for *BSD

This commit is contained in:
Dylan 2016-01-18 17:30:00 +11:00
parent 08ea6945fa
commit 432eb89e2d
1 changed files with 9 additions and 0 deletions

9
fetch
View File

@ -554,6 +554,15 @@ getcpu () {
*"BSD") *"BSD")
cpu="$(sysctl -n hw.model)" cpu="$(sysctl -n hw.model)"
cpu=${cpu/ @*/}
cpu=${cpu// /}
cpu=${cpu% }
speed=$(sysctl -n hw.cpuspeed)
speed=$((speed / 100))
speed=${speed:0:1}.${speed:1}
cpu="$cpu @ ${speed}GHz"
;; ;;
"Windows") "Windows")