Jabber Notification 4
A variation on the Gnome Notification theme with some jabber.
This time with some ruby:
#!/usr/bin/ruby
begin
require 'rubygems'
require 'xmpp4r/client'
rescue LoadError
puts "Couldn't load xmpp4r, you probably need to install it. Try gem install xmpp4r"
exit
end
include Jabber
jid = JID::new('your_user@example.com')
password = 'xxx'
cl = Client::new(jid)
cl.connect
cl.auth(password)
to = "your_user@example.com"
subject = "Notification from `$USER`"
ARGV.each do | message |
m = Message::new(to, message).set_type(:normal).set_id('1').set_subject(subject)
cl.send m
end
Run it like:
emerge something_that_takes_ages; notify.rb "Emerge Done"
You’ll need ruby, ruby gems, and the xmpp4r gem.
Enjoy.
Trackbacks
Use the following link to trackback from your own site:
http://blogs.divisibleprime.com/ronin/articles/trackback/947

Thank you for the informative and useful posts. I’ve been following you blog for a few months after discovering your “Command line Gnome Notification” article via Google. I’d like to suggest that you enable comments on your older articles (perhaps with a Captcha). I’d like to add some related information to them that I found helpful.
Hi Brian, thanks for reading the blog, I’ve opened comments on old posts now.
Thanks Kerry. I’ve added the comments I had written earlier. Look forward to more interesting articles, keep it up!
Kerry, this may interest you if you’d like portage’s ELOG system to handle jabber notifications automatically:
portage-mod-jabber