Linux User #381008
Ubuntu User #22532
You can play a sound from the terminal using "aplay /usr/share/sounds/alsa/Front_Center.wav" (obviously replace the file by the wav/mp3/ogg/etc that you'd like to play).
The way to integrate this into FBuntu would depend a little on whether you want the sound for Inbox Messages or for Notifications. I'll give you the notifications method, but I'm sure you could work out the same idea for inbox messages.
Open the graphNotificationChecker.py file, and at around line 64 change to:
(the bottom line is the important new one)Code:if notificationAlreadyKnown == False: self.logger.debug("Notification %s not previously known about" % (response['id'])) self.notificationArray.append(notification(self, response)) os.system('aplay /usr/share/sounds/alsa/Front_Center.wav')
And at the top of the file, you'll need to change to:
Code:import logging, urllib, urllib2, json, time, os
Last edited by fluteflute; May 16th, 2012 at 05:27 PM.
Linux User #381008
Ubuntu User #22532
Hey man, I was wondering if there is a way to limit how long the notification is? For instance There are some groups on facebook that have really long names and it makes the notifications bar really big and pushes it to one side of the screen. I'd be interested in trying to fix this myself but I don't know really where to start?
I was thinking would it be as easy as finding the notification variable, check to see the length of the string and if it is above a certain limit cut it down to a certain length followed by "..." for instance?
Because we're talking about notifications, you want the graphNotificationChecker.py file.
Line 100 says mmText = self.response['title']. This is the line that sets the text to be displayed in the messaging menu. Change that to mmText = self.response['title'][0:40] (change the 40 to anything you like).
Oh and if you want three dots afterwards, you'll need append that. So change the line to mmText = self.response['title'][0:40] + "...". Although that will add three dots whether or not the text has actually been chopped. I'll leave the full solution as a challenge for you to figure out (But do ask if you can't work it out.)
Last edited by fluteflute; May 20th, 2012 at 07:30 PM.
Linux User #381008
Ubuntu User #22532
Thanks man that was a lot more than I was expecting haha is mmText the name of the variable? Also is it stored as a matrix of sorts and you are limiting the columns to 40? Just trying to get my head around it. Haven't really done python. So could I do an if loop to check if mmText has > 40 columns then mmText = self.response['title'][0:40] + "..." else the normal way?
Bookmarks