[from now] 2014/10/21 23:50:28

diff --git a/.tmux/status-right.rb b/.tmux/status-right.rb
index b57b3f7..298d804 100755
--- a/.tmux/status-right.rb
+++ b/.tmux/status-right.rb
@@ -1,11 +1,13 @@
 #!/usr/bin/env ruby

 # Load Average
-load_avg = `uptime | awk '{print $(NF-2)}'`.chomp.to_f
+load_avg = `uptime | awk '{print $(NF-2)}'`.to_f
+cmd = `uname`.chomp == 'Linux' ? 'cat /proc/cpuinfo | grep cores' : 'system_profiler SPHardwareDataType | grep Cores'
+core = `#{cmd} | awk -F': ' '{print $2}'`.to_i

-if load_avg > 0.7
+if load_avg > core * 0.7
   load_bg = '#[bg=red,fg=black]'
-elsif load_avg > 0.5
+elsif load_avg > core * 0.5
   load_bg = '#[bg=yellow,fg=black]'
 else
   load_bg = '#[bg=green,fg=black]'