Last active
March 17, 2017 16:42
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set status-right "#(cpu.rb)" | |
set status-interval 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Author
AndrewVos
commented
Jul 31, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment