Commit c0261961 authored by Dylan's avatar Dylan

Fix stdout mode when used with cpu

parent 62973838
...@@ -959,8 +959,9 @@ getcpu () { ...@@ -959,8 +959,9 @@ getcpu () {
"bar") prin "${subtitle} Usage: $(bar "${cpu_usage/'%'}" $(( 100 * ${cores} )))" ;; "bar") prin "${subtitle} Usage: $(bar "${cpu_usage/'%'}" $(( 100 * ${cores} )))" ;;
"infobar") prin "${subtitle} Usage: ${cpu_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}" ;; "barinfo") prin "${subtitle} Usage: $(bar "${cpu_usage/'%'}" $(( 100 * ${cores} ))) ${cpu_usage}" ;;
"off") ;;
esac esac
unset cpu [ "$stdout_mode" != "on" ] && unset cpu
} }
# }}} # }}}
...@@ -2724,11 +2725,12 @@ while [ "$1" ]; do ...@@ -2724,11 +2725,12 @@ while [ "$1" ]; do
# Stdout # Stdout
--stdout) --stdout)
unset info_color colors unset info_color colors cpu_display bar prin
unset -f bar stdout_mode="on"
config="off"
case "$2" in case "$2" in
"--"* | "") printf "%s\n" "--stdout requires at least one argument"; exit ;; "--"* | "") printf "%s\n" "--stdout requires at least one argument"; exit ;;
*) shift; args=("$@"); config="off"; stdout ;; *) shift; args=("$@"); stdout ;;
esac esac
;; ;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment