Create a gist now

Instantly share code, notes, and snippets.

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
Owner

rabbit

turtle

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