Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Tmux status that draws a rabbit if your cpu is not in heavy use, or a turtle if it is
set status-right "#(cpu.rb)"
set status-interval 5
#!/usr/bin/env ruby
# encoding: UTF-8
usage = `echo $(top -l 1 | grep "CPU usage:")`
idle = Float(usage.scan(/(\d+\.\d+)\% idle/)[0][0])
if idle < 20
print " 🐢 "
else
print " 🐇 "
end
@AndrewVos

This comment has been minimized.

Show comment Hide comment
@AndrewVos

AndrewVos Jul 31, 2013

rabbit

turtle

Owner

AndrewVos commented Jul 31, 2013

rabbit

turtle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment