Last active
March 21, 2016 12:39
-
-
Save lkosak/5399510 to your computer and use it in GitHub Desktop.
eventcmd for mcabber that provides native OSX notifications for incoming messages (requires the terminal-notifier ruby gem)
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 | |
require 'terminal-notifier' | |
event, arg1, arg2, filename = ARGV | |
# log = File.open 'eventcmd.log', 'a' | |
# log.write "#{event}, #{arg1}, #{arg2}, #{filename}\n" | |
case event | |
when "MSG" | |
case arg1 | |
when "IN" | |
if filename and File.exists?(filename) | |
msg = File.read filename | |
File.delete filename | |
else | |
msg = "" | |
end | |
TerminalNotifier.notify(msg, title: "#{arg2} says...") | |
when "OUT" | |
end | |
when "STATUS" | |
when "UNREAD" | |
end | |
# log.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment