* clemens fischer <ino-n...@spotteswoode.dnsalias.org> [2010-06-01 17:30:36 +0200]:
> Vincent Wang wrote: > > > I wrote a very simple ruby script that define a action map, regex as > > key, a function as value, so you can define as many different actions > > as you need based on regex, that can solve the problem. > > You mean actions triggered by window-content? Can you post it or send > by private email? Here is it: #! /usr/bin/env ruby event_hash = { /^=> Ctrl-C to shutdown server/ => lambda { ["Rails started"] }, /^(\d+ tests, \d+ assertions, \d+ failures, \d+ errors)/ => lambda { [$1, "Ruby Test"] }, } def notify(msg, title="Notification") system(%Q{/usr/local/bin/growlnotify --image ~/Desktop/mylogo.png -n "ShellNotification" -m "#{msg}" "#{title}" 2>/dev/null;}) end ARGF.each do |line| event_hash.each_pair do |k, v| notify(*v.call) if line =~ k end end You need to copy these lines into a file(for example notification.rb) and make it executable or you can use the file in attachment. BR Vincent > > > clemens > > > ------------------------------------------------------------------------------ > > _______________________________________________ > tmux-users mailing list > tmux-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/tmux-users -- "There are very few problems in Computer Science that cannot be solved with an additional level of indirection." http://blog.linsong.org
#! /usr/bin/env ruby event_hash = { /^=> Ctrl-C to shutdown server/ => lambda { ["Rails started"] }, /^(\d+ tests, \d+ assertions, \d+ failures, \d+ errors)/ => lambda { [$1, "Ruby Test"] }, } def notify(msg, title="Notification") system(%Q{/usr/local/bin/growlnotify --image ~/Desktop/mylogo.png -n "ShellNotification" -m "#{msg}" "#{title}" 2>/dev/null;}) end ARGF.each do |line| event_hash.each_pair do |k, v| notify(*v.call) if line =~ k end end
------------------------------------------------------------------------------
_______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users