Windows: cpu support
This commit is contained in:
parent
736b06ea3c
commit
cb8444c41a
15
fetch.sh
15
fetch.sh
|
@ -446,6 +446,21 @@ getcpu () {
|
||||||
cpu="$(sysctl -n hw.model)"
|
cpu="$(sysctl -n hw.model)"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Windows")
|
||||||
|
# Get cpu name
|
||||||
|
cpu="$(grep 'model name' /proc/cpuinfo)"
|
||||||
|
cpu=${cpu/model name*: /}
|
||||||
|
|
||||||
|
speed=$(grep 'cpu MHz' /proc/cpuinfo)
|
||||||
|
speed=${speed/cpu MHz*: /}
|
||||||
|
speed=${speed/\./}
|
||||||
|
|
||||||
|
# Convert mhz to ghz without bc
|
||||||
|
speed=$((${speed} / 1000))
|
||||||
|
speed=${speed:0:1}.${speed:1}
|
||||||
|
cpu="$cpu @ ${speed}GHz"
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
cpu="Unknown"
|
cpu="Unknown"
|
||||||
;;
|
;;
|
||||||
|
|
Reference in New Issue