Skip to content

Instantly share code, notes, and snippets.

@adkron
Created November 14, 2013 16:36
Show Gist options
  • Select an option

  • Save adkron/7469930 to your computer and use it in GitHub Desktop.

Select an option

Save adkron/7469930 to your computer and use it in GitHub Desktop.
class Notify
include Weechat
def notify_msg( data, buffer, date, tags, visible, highlight, prefix, message )
if highlight.to_i != 0
TerminalNotifier.execute(verbose = false, message: message)
end
return WEECHAT_RC_OK
end
def notify_msg( data, buffer, date, tags, visible, highlight, prefix, message )
end
end
def weechat_init
require "terminal-notifier"
Weechat::register *["notify", "Amos King", "0.1", "MIT", "Notify OSX Message Center", "", ""]
Weechat.hook_print( '', '', '', 1, 'notify_msg', '' )
TerminalNotifier.execute(verbose = false, message: "Loaded Weechat Notify")
return Weechat::WEECHAT_RC_OK
end
def notify_msg(*args)
Notify.new.notify_msg *args
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment