Added cpu speed for *BSD

This commit is contained in:
Dylan 2016-01-18 17:30:00 +11:00
parent 08ea6945fa
commit 432eb89e2d

9
fetch
View file

@ -554,6 +554,15 @@ getcpu () {
*"BSD")
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")