CPU: Don't simplify option names for no reason
This commit is contained in:
parent
f3bfd5a9f5
commit
440153e7d8
|
@ -134,11 +134,12 @@ shell_version="on"
|
||||||
|
|
||||||
# CPU speed type
|
# CPU speed type
|
||||||
#
|
#
|
||||||
# Default: 'bios'
|
# Default: 'bios_limit'
|
||||||
# Values: 'current', 'min', 'max', 'bios',
|
# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'.
|
||||||
# Flag: --speed_type
|
# Flag: --speed_type
|
||||||
# Supports: Linux with 'cpufreq'
|
# Supports: Linux with 'cpufreq'
|
||||||
speed_type="bios"
|
# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value.
|
||||||
|
speed_type="bios_limit"
|
||||||
|
|
||||||
# Shorten the output of the CPU function
|
# Shorten the output of the CPU function
|
||||||
#
|
#
|
||||||
|
|
11
neofetch
11
neofetch
|
@ -734,23 +734,16 @@ get_cpu() {
|
||||||
"Android"*) cpu="$(getprop ro.product.board)" ;;
|
"Android"*) cpu="$(getprop ro.product.board)" ;;
|
||||||
*) cpu="$(awk -F ': | @' '/model name|Processor/ {printf $2; exit}' /proc/cpuinfo)" ;;
|
*) cpu="$(awk -F ': | @' '/model name|Processor/ {printf $2; exit}' /proc/cpuinfo)" ;;
|
||||||
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"
|
temp_dir="/sys/class/hwmon/hwmon0/temp1_input"
|
||||||
|
|
||||||
# Get cpu speed
|
# Get cpu speed
|
||||||
if [[ -d "$speed_dir" ]]; then
|
if [[ -d "$speed_dir" ]]; then
|
||||||
case "$speed_type" in
|
# Fallback to bios_limit if $speed_type fails.
|
||||||
"current") speed_type="scaling_cur_freq" ;;
|
|
||||||
"min") speed_type="scaling_min_freq" ;;
|
|
||||||
"max") speed_type="scaling_max_freq" ;;
|
|
||||||
"bios") speed_type="bios_limit" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Fallback to cpuinfo_max_freq if $speed_type fails
|
|
||||||
speed="$(< "${speed_dir}/${speed_type}")" || \
|
speed="$(< "${speed_dir}/${speed_type}")" || \
|
||||||
speed="$(< "${speed_dir}/bios_limit")" || \
|
speed="$(< "${speed_dir}/bios_limit")" || \
|
||||||
speed="$(< "${speed_dir}/scaling_max_freq")"
|
speed="$(< "${speed_dir}/scaling_max_freq")"
|
||||||
|
|
||||||
speed="$((speed / 100000))"
|
speed="$((speed / 100000))"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
Reference in New Issue