This works only for Ubuntu since it uses "notify-send", maybe there is a general notification system but I don't know.
Usage:
1. Copy code and save it somewhere as mgalert.py
2. In Hexchat: Menu > Window > Plugins and Scripts
3. In Plugins and Scripts: Load > mgalert.py
If you have installed megaglest in home directory it should display an icon.
#https://www.gnu.org/copyleft/gpl.html
__module_name__ = "MG Alert"
__module_version__ = "1.0"
__module_description__ = "Makes an alert when someone joins megaglest-lobby"
import hexchat, subprocess, getpass
def join_cb(word, word_eol, userdata):
channel = word_eol[2]
channel = channel[:16]
if channel == "#megaglest-lobby":
user = str.split(word[0] , "!")
user = user[0][1:len(user[0])]
prefix = user[:3]
if prefix == "MG_":
user = str.split(user, "_")
user = user[1]
subprocess.call(['notify-send', '-i', '/home/'+getpass.getuser()+'/megaglest/megaglest.ico','Megaglest',user+' has joined.'])
hexchat.hook_server("join", join_cb)