[PR] dylanaraps/neofetch#1961 from satmandu - Add CPU temp file for Raspberry Pi/linux and fix CPU detection for Raspberry Pi devices
Upstream PR: https://github.com/dylanaraps/neofetch/pull/1961 Thanks to @satmandu Co-authored-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
commit
aac56be0c1
1 changed files with 6 additions and 1 deletions
7
neofetch
7
neofetch
|
@ -2392,7 +2392,7 @@ get_cpu() {
|
|||
;;
|
||||
|
||||
*)
|
||||
cpu="$(awk -F '\\s*: | @' \
|
||||
[[ -z "$cpu" ]] && cpu="$(awk -F '\\s*: | @' \
|
||||
'/model name|Hardware|Processor|^cpu model|chip type|^cpu type/ {
|
||||
cpu=$2; if ($1 == "Hardware") exit } END { print cpu }' "$cpu_file")"
|
||||
;;
|
||||
|
@ -2408,6 +2408,11 @@ get_cpu() {
|
|||
break
|
||||
}
|
||||
done
|
||||
|
||||
# If on a Raspberry Pi...
|
||||
if grep -q "Raspberry Pi" /proc/device-tree/model; then
|
||||
temp_dir=/sys/class/thermal/thermal_zone0/temp
|
||||
fi
|
||||
|
||||
# Get CPU speed.
|
||||
if [[ -d "$speed_dir" ]]; then
|
||||
|
|
Loading…
Reference in a new issue