master
yutent 2024-01-09 17:47:24 +08:00
parent 75ff0b9af3
commit 8180b3ac44
1 changed files with 1 additions and 3 deletions

View File

@ -150,16 +150,14 @@ function get_shell(){
function get_cpu() { function get_cpu() {
cpu=$(lscpu | awk -F '\\s*: | @' '/Model name/ {print $2}') cpu=$(lscpu | awk -F '\\s*: | @' '/Model name/ {print $2}')
cpu_cores=$(lscpu | awk -F '\\s*: | @' '/^CPU\(s\):/ {print $2}')
cpu_speed=$(lscpu | awk -F '\\s*: | @' '/CPU max MHz/ {print $2}') cpu_speed=$(lscpu | awk -F '\\s*: | @' '/CPU max MHz/ {print $2}')
cpu_cores=$(trim "$cpu_cores")
cpu_speed=$(trim "$cpu_speed") cpu_speed=$(trim "$cpu_speed")
cpu_speed=${cpu_speed%.*} cpu_speed=${cpu_speed%.*}
cpu_speed="$((cpu_speed / 1000)).${cpu_speed:1}" cpu_speed="$((cpu_speed / 1000)).${cpu_speed:1}"
cpu=$(trim "$cpu" | sed -e 's/ Gen//') cpu=$(trim "$cpu" | sed -e 's/ Gen//')
cpu+=" (${cpu_cores}) ${cpu_speed}GHz" cpu+=" ($(nproc)) ${cpu_speed}GHz"
} }
function get_gpu() { function get_gpu() {