xchat notifier plugin

I previously mentioned that there must be a better way to make xchat pop up a dialog box, and of course there is, the plugin!

It's so easy; though finding the text command to match is a bit obscure. Here it is

__module_name__ = "gnome-notifier-plugin"
__module_version__ = "1.0"
__module_description__ = "notify of channel events via gnome-notify"

import xchat
import os

def channel_message(word, word_eol, userdata):

    err = os.system("/usr/bin/gnome-notify " +
                    "\'<font color=\"red\">New channel message</font></br>" +
                    "<b>"+word[0]+"</b><br>"+word[1]+"\'")
    if (err != 0):
        print("Failed to launch gnome-notify!")
    return xchat.EAT_NONE

xchat.hook_print("Channel Msg Hilight", channel_message)

you just put that in your .xchat2 directory and next thing you know you should have screenshots like that below!

gnome-notifier xchat plugin

xchat notifier

In a previous post I mentioned I wanted an IRC notifier; I got the notifier working but can't really plug it into xchat.

As far as I can tell (and I didn't look that much, the only way I can get the notifier to fire when xchat matches my username in a message is to use the sound infrastructure. Each event can have sound play, and you can specifiy the program to play the sound. Thus I use this with a bogus filename like " You've got a message" ... the only problem is the box has the full path to the filename in it.

xchat must have a better way to handle this sort of thing ...