Guest User

Untitled

a guest
Aug 5th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. ## earthquake.gem to tmux status-right
  2. ## use :tmux command to set on/off
  3.  
  4. Earthquake.init do
  5. once do
  6. @tmux_status = false
  7. end
  8.  
  9. command :tmux do
  10. @tmux_status = (@tmux_status)? false : true
  11. puts "send to tmux-status-right: #{@tmux_status}"
  12. end
  13.  
  14. output do |item|
  15. if !ENV["TMUX"].nil? and @tmux_status
  16. next unless item["text"]
  17. system "tmux set -g status-right '#{item["user"]["screen_name"]}: #{item["text"].truncate(80,:omission => "...")}' > /dev/null"
  18. end
  19. end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment