XFCE4 Generic Monitor panel applet – for more than just hardware!

Since the demise of google reader, I like many people have taken to using their own server as an RSS reader – that way at least you can know why post’s you’ve read regardless of which device you happen to grab nearby…

It is handy to keep an occasional eye on the number of unread post and while I had a simple plug in for Firefox now a days you need to get your code vetted by Firefox (there is a way round this) but something in a new update of Firefox stopped the plug in working and I came to the conclusion its all just too much trouble for a paragraph of Javascript….

Before setting out to write my own XFCE4 panel applet I decided to have a better look through what was available, one applet did catch my attention the Generic Monitor, this was initially designed by the look of things to execute something like

cat /proc/acpi/to/hot/to/handle/temprature

At a chosen time interval it would run the command specified and put the textual output on the panel.  Well as you know if you can run something like that then there is a good chance you can get online data too.

curl -L bedroomcoders.co.uk/unreadRssCount/?FOR=someone

and what do you know its quite happy doing this too, of course my immediate thought was wouldn’t it be nice if when I clicked the panel app it took me to the login page of my rss reader – yes I really am the lazy.

Time to do a hacking! no…. wait – I did a terrible thing I… read the documentation…. yes I know a terrible terrible sin….

Turns out that in their evolution to feature completeness the developers had similar needs… after just a few minutes I had just the script for the panel applet to fit the bill

echo "<img>/home/chris/bin/rss.png</img>"
echo "<txt>$(curl -L bedroomcoders.co.uk/unreadRssCount/?FOR=someone)</txt>"
echo "<click>xdg-open http://bedroomcoders.co.uk/RssReader/Login</click>"

I made a tiny RSS image (I like my tool bars slim!) and the rest is just a very simple bash script to output an XML “document” for the button image and the command that’s executed when its clicked.

I set the time interval 1200 seconds (20 mins) because – why bother with anything faster for that kind of information…

Sweet, simple and works really well.

Leave a Reply

Your email address will not be published.