Skip to content

Instantly share code, notes, and snippets.

@igrep
Created May 8, 2010 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save igrep/394273 to your computer and use it in GitHub Desktop.
Save igrep/394273 to your computer and use it in GitHub Desktop.
=begin
Termtter plugin.
Mark everytime timeline is updated. inspired by plugin/mark.rb
=end
config.plugins.mark_on_update.set_default( :wrap_color, 'on_red' )
config.plugins.mark_on_update.set_default( :time_format, 'TIMELINE at %R' )
Termtter::Client.register_hook(
:name => :mark_on_update,
:points => [:post_filter],
:exec_proc => Proc.new {
width = `stty size`.split(' ')[1].to_i
mes = Time.now.strftime( config.plugins.mark_on_update.time_format )
puts ::TermColor.colorize( mes.center( width ), config.plugins.mark_on_update.wrap_color )
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment