Created
August 22, 2012 06:30
-
-
Save KaiSmith/3422932 to your computer and use it in GitHub Desktop.
Creates a notification bubble when you receive a Facebook message.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
#Dependencies: fbcmd | |
#Only tested for version 1.x | |
#Make sure to create file ~/Documents/LatestMessage.txt first | |
#Very useful to set as a program to run on startup | |
#!/usr/bin/bash | |
while true; do | |
in=`fbcmd inbox unread | grep ':' | head -n 2` | |
if [ "$in" != "`head ~/Documents/LatestMessage.txt`" ] && [ "$in" != "" ]; then | |
from=$(echo $in | awk '{print "New Meassage From",$2,$3}') | |
snip=`echo "$in" | tail -n 1 | sed -e 's/\s*:*snippet:*\s*//'` | |
echo "$in">~/Documents/LatestMessage.txt | |
notify-send -i ~/Pictures/facebook_logo.png "$from" "$snip" | |
fi | |
sleep 30 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment