mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-10-04 09:08:38 +00:00
Windows: cpu support
This commit is contained in:
15
fetch.sh
15
fetch.sh
@@ -446,6 +446,21 @@ getcpu () {
|
||||
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"
|
||||
;;
|
||||
|
Reference in New Issue
Block a user