Skip to content

Instantly share code, notes, and snippets.

@AndrewVos
Last active March 17, 2017 16:42
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewVos/6123100 to your computer and use it in GitHub Desktop.
Save AndrewVos/6123100 to your computer and use it in GitHub Desktop.
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
Copy link
Author

rabbit

turtle

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