mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-10-03 16:51:29 +00:00
cpu_temp: Detect CPU temperature file.
This commit is contained in:
7
neofetch
7
neofetch
@@ -926,7 +926,12 @@ get_cpu() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
speed_dir="/sys/devices/system/cpu/cpu0/cpufreq"
|
speed_dir="/sys/devices/system/cpu/cpu0/cpufreq"
|
||||||
temp_dir="/sys/class/hwmon/hwmon0/temp1_input"
|
|
||||||
|
# Select the right temperature file.
|
||||||
|
for temp_dir in /sys/class/hwmon/*; do
|
||||||
|
[[ "$(< "${temp_dir}/name")" =~ (coretemp|fam15h_power) ]] && \
|
||||||
|
{ temp_dir="${temp_dir}/temp1_input"; break; }
|
||||||
|
done
|
||||||
|
|
||||||
# Get CPU speed.
|
# Get CPU speed.
|
||||||
if [[ -d "$speed_dir" ]]; then
|
if [[ -d "$speed_dir" ]]; then
|
||||||
|
Reference in New Issue
Block a user