mirror of
https://github.com/tmux-plugins/tmux-cpu.git
synced 2026-09-10 07:16:16 -04:00
parent
00ab1d2cda
commit
8f52392712
|
|
@ -14,11 +14,11 @@ print_cpu_temp() {
|
|||
if command_exists "sensors"; then
|
||||
local val
|
||||
if [[ "$cpu_temp_unit" == F ]]; then
|
||||
val=$(sensors -f)
|
||||
val="$(sensors -f)"
|
||||
else
|
||||
val=$(sensors)
|
||||
val="$(sensors)"
|
||||
fi
|
||||
val | sed -e 's/^Tccd/Core /' | awk -v format="$cpu_temp_format$cpu_temp_unit" '/^Core [0-9]+/ {gsub("[^0-9.]", "", $3); sum+=$3; n+=1} END {printf(format, sum/n)}'
|
||||
echo "$val" | sed -e 's/^Tccd/Core /' | awk -v format="$cpu_temp_format$cpu_temp_unit" '/^Core [0-9]+/ {gsub("[^0-9.]", "", $3); sum+=$3; n+=1} END {printf(format, sum/n)}'
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ put_cache_val() {
|
|||
local val
|
||||
local tmpdir
|
||||
key="$1"
|
||||
val="$2"
|
||||
val="${*:2}"
|
||||
tmpdir="$(get_tmp_dir)"
|
||||
[ ! -d "$tmpdir" ] && mkdir -p "$tmpdir" && chmod 0700 "$tmpdir"
|
||||
get_time >"$tmpdir/$key"
|
||||
|
|
|
|||
Loading…
Reference in a new issue