From db22297738ce25dab6c8aa4aadf63818bbb8b77d Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 2 Jan 2017 11:27:37 +1100 Subject: [PATCH] CPU Temp: Fix issue with old values --- neofetch | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 13d3f31f..9810b290 100755 --- a/neofetch +++ b/neofetch @@ -2825,11 +2825,13 @@ get_user_config() { if [[ -f "$config_file" ]]; then source "$config_file" err "Config: Sourced user config. (${config_file})" + old_options return elif [[ "$config_file" == "travis" ]]; then source "$travis_config" err "Config: Sourced user config. (${travis_config})" + old_options return fi mkdir -p "${XDG_CONFIG_HOME}/neofetch/" @@ -2856,8 +2858,6 @@ get_user_config() { source "$config_file" err "Config: Sourced user config. (${config_file})" - - # Check for deprecated options. old_options } @@ -3009,6 +3009,9 @@ old_options() { # $start and $end were replaced with ${block_range[@]} in 2.1.0. [[ "$start" && "$end" ]] && { err "Config: \$start and \$end are deprecated, use block_range=(0 7) instead."; block_range=("$start" "$end"); } + + # Fahrenheit support was added to CPU so the options were changed. + [[ "$cpu_temp" == "on" ]] && { err "Config: cpu_temp='on' is deprecated, use cpu_temp='C' or 'F' instead."; cpu_temp="C"; } } cache_uname() { @@ -3336,7 +3339,6 @@ get_args() { "--os_arch") os_arch="$2" ;; "--cpu_cores") cpu_cores="$2" ;; "--cpu_speed") cpu_speed="$2" ;; - "--cpu_temp") cpu_temp="$2" ;; "--speed_type") speed_type="$2" ;; "--distro_shorthand") distro_shorthand="$2" ;; "--kernel_shorthand") kernel_shorthand="$2" ;; @@ -3354,6 +3356,11 @@ get_args() { "--song_shorthand") song_shorthand="$2" ;; "--install_time") install_time="$2" ;; "--install_time_format") install_time_format="$2" ;; + "--cpu_temp") + cpu_temp="$2" + [[ "$cpu_temp" == "on" ]] && cpu_temp="C" + ;; + "--disable") for func in "$@"; do case "$func" in