Skip to content

Instantly share code, notes, and snippets.

@bdimcheff
Created March 27, 2013 15:07
Show Gist options
  • Save bdimcheff/5254934 to your computer and use it in GitHub Desktop.
Save bdimcheff/5254934 to your computer and use it in GitHub Desktop.
pidgin notifier
#!/bin/bash
DIR=`dirname $0`
$DIR/pidgin_notifier.py | grep -v --line-buffered "^Brandon Dimcheff" | grep -i --line-buffered "\(brandon\)\|\(bdimchef\)\|\(@all\)" | while read line;do notify-send -- "Mentioned in HipChat" "${line}";done
#!/bin/bash
if ps -ef | grep -v grep | grep "notifier.sh" ; then
exit 0
else
/home/bdimchef/Documents/Olark/bin/notifier.sh > /dev/null &
fi
#!/usr/bin/env python2.7
import sys
def my_func(account, sender, message, conversation, flags):
print sender.encode('utf-8'), u":", message.encode('utf-8')
sys.stdout.flush()
import dbus, gobject
from dbus.mainloop.glib import DBusGMainLoop
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()
bus.add_signal_receiver(my_func,
dbus_interface="im.pidgin.purple.PurpleInterface",
signal_name="ReceivedChatMsg")
loop = gobject.MainLoop()
loop.run()
@bdimcheff
Copy link
Author

open gnome-session-properties and add a thing that executes notifier_watchdog.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment