• HowTo: Facebook notifications in Conky
    13 replies, posted
This seems like the best place to post this, but this is Facepunch, so if I'm wrong, someone please correct me. I was bored, and was looking for a way to easily get Facebook notifications on Ubuntu, since I always have my conky visible, I figured that was a good place to start. This requires [URL="http://fbcmd.dtompkins.com/installation"]fbcmd[/URL] which is pretty easy to install, and I've found it to be rather useful. Decided to just combined it all into a single script, rather messy, but it works. [CODE]#!/bin/bash if [ "$1" = "message" ] then msgcount=$(fbcmd NOTIFY | grep MESSAGES_UNREAD | grep -oE "[[:digit:]]{1,}") if [ "$msgcount" -eq "0" ] then echo No New Messages elif [ "$msgcount" -eq "1" ] then echo '${color white}'$msgcount'${color aaaaaa}' MESSAGE else echo '${color white}'$msgcount'${color aaaaaa}' MESSAGES fi elif [ "$1" = "poke" ] then pokecount=$(fbcmd NOTIFY | grep POKES | grep -oE "[[:digit:]]{1,}") if [ "$pokecount" -eq "0" ] then echo No One Has Poked You elif [ "$pokecount" -eq "1" ] then echo '${color white}'$pokecount'${color aaaaaa}' PERSON HAS POKED YOU else echo '${color white}'$pokecount'${color aaaaaa}' PEOPLE HAVE POKED YOU fi elif [ "$1" = "notify" ] then notifycount=$(fbcmd NOTICES unread | grep -c :title) if [ "$notifycount" -eq "0" ] then echo No New Notifications elif [ "$notifycount" -eq "1" ] then echo '${color white}'$notifycount'${color aaaaaa}' NOTIFICATION else echo '${color white}'$notifycount'${color aaaaaa}' NOTIFICATIONS fi else echo "Please state a command, [message,poke,notify]" fi [/CODE] Simple script, but I felt like sharing it anyway. Add to your conky like so... [CODE]${color white} $alignr FACEBOOK ${color aaaaaa} $alignr ${execpi 15 ~/.scripts/facebook notify} ${color aaaaaa} $alignr ${execpi 15 ~/.scripts/facebook poke} ${color aaaaaa} $alignr ${execpi 15 ~/.scripts/facebook message}[/CODE] ...and you're good. [IMG]http://img837.imageshack.us/img837/3315/selection010e.png[/IMG][IMG]http://img837.imageshack.us/img837/4760/selection009i.png[/IMG][IMG]http://img837.imageshack.us/img837/3135/screenshotwpd.png[/IMG]
>Implying people who use linux actually have a facebook and friends.
Well, I can name at least one person
[QUOTE=Maccabee;24582584]>Implying people who use linux actually have a facebook and friends.[/QUOTE] lol this post made me smile
Thats pretty cool.
[QUOTE=Maccabee;24582584]>Implying people who use linux actually have a facebook and friends.[/QUOTE] Implying people who use Macs aren't gay.
[QUOTE=andersonmat;24589439]Implying people who use Macs aren't gay.[/QUOTE] [sp]zing[/sp]
Cool, I want something for windows though.
[QUOTE=nicatronTg;24591040]Cool, I want something for windows though.[/QUOTE] I made something similar in Java earlier. Lemme see if I can find it mixed with all of my other junk on my hard drives.
[QUOTE=andersonmat;24589439]Implying people who use Macs aren't gay.[/QUOTE] >Implying I'm not gay.
[QUOTE=Maccabee;24582584]>Implying people who use linux actually have a facebook and friends.[/QUOTE] >implying that I'm not on your facebook friends list
[QUOTE=andersonmat;24589439]Implying people who use Macs aren't hipsters or gay.[/QUOTE] Fix'd
[QUOTE=Maccabee;24582584]>Implying people who use linux actually have a facebook and friends.[/QUOTE] Don't know why people rated agree.
[QUOTE=Maccabee;24598347]>Implying I'm not gay.[/QUOTE] Zing
Sorry, you need to Log In to post a reply to this thread.