From c02619616fe32f49a9f985a8f167a107ae37ef43 Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 17 Mar 2016 16:10:16 +1100 Subject: [PATCH] Fix stdout mode when used with cpu --- neofetch | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/neofetch b/neofetch index 1dd1d335..db34b5d5 100755 --- a/neofetch +++ b/neofetch @@ -959,8 +959,9 @@ getcpu () { "bar") prin "${subtitle} Usage: $(bar "${cpu_usage/'%'}" $(( 100 * ${cores} )))" ;; "infobar") prin "${subtitle} Usage: ${cpu_usage} $(bar "${cpu_usage/'%'}" $(( 100 * ${cores} )))" ;; "barinfo") prin "${subtitle} Usage: $(bar "${cpu_usage/'%'}" $(( 100 * ${cores} ))) ${cpu_usage}" ;; + "off") ;; esac - unset cpu + [ "$stdout_mode" != "on" ] && unset cpu } # }}} @@ -2724,11 +2725,12 @@ while [ "$1" ]; do # Stdout --stdout) - unset info_color colors - unset -f bar + unset info_color colors cpu_display bar prin + stdout_mode="on" + config="off" case "$2" in "--"* | "") printf "%s\n" "--stdout requires at least one argument"; exit ;; - *) shift; args=("$@"); config="off"; stdout ;; + *) shift; args=("$@"); stdout ;; esac ;;