added condition for ryzen to CPU temperature.#81
Open
basaran wants to merge 1 commit intotmux-plugins:masterfrom
Open
added condition for ryzen to CPU temperature.#81basaran wants to merge 1 commit intotmux-plugins:masterfrom
basaran wants to merge 1 commit intotmux-plugins:masterfrom
Conversation
casperdcl
reviewed
Dec 6, 2022
Comment on lines
+21
to
+30
| val=$(echo "$val" | sed -e 's/^Tccd/Core /') | ||
| if [[ $val =~ Core ]]; then | ||
| echo "$val" | 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)}' | ||
| elif [[ $val =~ Tctl ]]; then | ||
| echo "$val" | sed -n 's/Tctl:\s*+//p' | tr -d " " | ||
| elif [[ $val =~ Tdie ]]; then | ||
| echo "$val" | sed -n 's/Tdie:\s*+//p' | tr -d " " | ||
| else | ||
| echo "NA" | ||
| fi |
Collaborator
There was a problem hiding this comment.
maybe this?
Suggested change
| val=$(echo "$val" | sed -e 's/^Tccd/Core /') | |
| if [[ $val =~ Core ]]; then | |
| echo "$val" | 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)}' | |
| elif [[ $val =~ Tctl ]]; then | |
| echo "$val" | sed -n 's/Tctl:\s*+//p' | tr -d " " | |
| elif [[ $val =~ Tdie ]]; then | |
| echo "$val" | sed -n 's/Tdie:\s*+//p' | tr -d " " | |
| else | |
| echo "NA" | |
| fi | |
| echo "$val" | sed -r -e 's/^(Tccd|Tctl:|Tdie:)/Core /' | awk -v format="$cpu_temp_format$cpu_temp_unit" '/^Core\s+[0-9]+/ {gsub("[^0-9.]", "", $3); sum+=$3; n+=1} END {printf(format, sum/n)}' |
There was a problem hiding this comment.
This is not working for my CPU (AMD Ryzen 9 3950X). The original proposal somehow works for me.
Collaborator
There was a problem hiding this comment.
Hmm. Can you post the output of sensors?
There was a problem hiding this comment.
Sorry, I'm a little bit busy lately. Here's my sensors output:
➜ sensors
iwlwifi_1-virtual-0
Adapter: Virtual device
temp1: N/A
k10temp-pci-00c3
Adapter: PCI adapter
Tdie: +57.8°C (high = +70.0°C)
Tctl: +57.8°C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #78