From 3ec7e1a038e2326843aec6885f9f1f0234a567df Mon Sep 17 00:00:00 2001 From: Ethan Edwards Date: Tue, 2 Jun 2020 22:55:14 -0400 Subject: [PATCH] For some reason branch wasnt up to date? Fixed --- scripts/cpu_info.sh | 28 ++-------------------------- scripts/dracula.sh | 5 ----- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/scripts/cpu_info.sh b/scripts/cpu_info.sh index 8879fb3..cee644f 100755 --- a/scripts/cpu_info.sh +++ b/scripts/cpu_info.sh @@ -2,8 +2,7 @@ get_percent() { - arg=$1 - case "$arg" in + case $(uname -s) in Linux) percent=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1"%"}') echo $percent @@ -19,33 +18,10 @@ get_percent() ;; esac } -check_os() -{ - # Check os - case $(uname -s) in - Linux) - get_percent Linux - ;; - - Darwin) - get_percent Mac - ;; - - CYGWIN*|MINGW32*|MSYS*|MINGW*) - get_percent Windows - # leaving empty - TODO - windows compatability - ;; - - *) - ;; - esac -} - - main() { - cpu_percent=$(check_os) + cpu_percent=$(get_percent) echo "CPU $cpu_percent" sleep 10 } diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 1e567e8..fbf27f8 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -66,11 +66,6 @@ main() $current_dir/sleep_weather.sh $show_fahrenheit & fi - # start cpu script in the background - if $show_cpu_percentage; then - $current_dir/cpu_info.sh & - fi - # sets refresh interval to every 5 seconds tmux set-option -g status-interval 5