@@ -0,0 +1,1724 @@
+#!/usr/bin/python%0A%0Aimport pynotify%0Aimport praw%0Aimport sys%0Aimport time%0Aimport os%0A%0A# Reddit stuff%0A%0Ausername = ''%0Apassword = ''%0Adir = os.path.dirname(os.path.realpath(__file__));%0A%0Ar = praw.Reddit('/u/'+username+' linux desktop notification system by /u/balrogath, v 0.8')%0Ar.login(username, password)%0A%0A# notifications we've already been notified about%0Aalready_done = %5B%5D%0A%0A# forever!%0Awhile True:%0A%09try:%0A%09%09print 'Retrieving messages'%0A%09%09# lovely orangereds! filthy periwinkle...%0A%09%09unread = r.get_unread()%0A%09%09for message in unread:%0A%09%09%09if message.id not in already_done:%0A%09%09%09%09# we don't want to repeat notifications, now do we?%0A%09%09%09%09already_done.append(message.id)%0A%09%09%09%09print 'Displaying unread...'%0A%09%09%09%09# truncate subject and body%0A%09%09%09%09subj = message.subject%5B:30%5D + (message.subject%5B30:%5D and '...')%0A%09%09%09%09body = message.body%5B:140%5D + (message.body%5B140:%5D and '...')%0A%09%09%09%09# friendly%0A%09%09%09%09auth = message.author.name%0A%0A%09%09%09%09# get da notification ready%0A%09%09%09%09pynotify.init('reddit_indicator')%0A%0A%09%09%09%09# but what type of notification?%0A%09%09%09%09if message.was_comment:%09%0A%09%09%09%09%09n = pynotify.Notification('Comment reply from %25s'%25(auth),%0A%09%09%09%09%09%09'%25s'%25(body),%0A%09%09%09%09%09%09dir+'/orangered.png')%0A%09%09%09%09else:%0A%09%09%09%09%09n = pynotify.Notification('Message from %25s: %25s'%25(auth,subj),%0A%09%09%09%09%09%09'%25s'%25(body),%0A%09%09%09%09%09%09dir+'/orangered.png')%0A%0A%09%09%09%09# show the world! or whatever%0A%09%09%09%09n.show()%0A%09%09# yes, sleep.....%09%09%09%09%0A%09%09time.sleep(60)%0A%0A%09except Exception as e:%0A%09%09# Ohnoes!%0A%09%09print 'Error!'%0A%09%09e = str(e)%0A%0A%09%09# show the error%0A%09%09pynotify.init('reddit_indicator')%0A%09%09n = pynotify.Notification(%22Error occured!%22,%0A%09%09%09'%25s'%25(e),%0A%09%09%09dir+'/redditerror.png')%0A%09%09n.show()%0A%0A%09%09# log the error%0A%09%09with open(%22redditerror.txt%22, %22a%22) as errlog:%0A%09%09%09errlog.write(%22%5Cn%5Cn%22+e)%0A%0A%09%09# sleep a little bit longer than usual%0A%09%09time.sleep(120)%0A

Create reddindicator.py