Linux Blog

Become independent of the system tray using conky.

Filed under: General Linux,The Linux Blog News — Kaleb at 9:19 pm on Thursday, February 7, 2008

Hello everybody it is I Kaleb from over at http://kpstuff.servebeer.com again come to talk today about an app that I have been using for a while but just recently decided to make it fix my dependence of the system tray all together.

If you read my blog regularly you would know that I am not a fan of GUI applications, I use as few of them as possible. I prefer to use command line programs instead for many reasons: one they are faster, two they are easier and quicker to use/access the features that I want from them, and three I just like the way they look.

For a long time I have used the Fluxbox window manager because it is small lightweight and over all pretty. But no matter what window manager I use: Gnome, KDE, Xfce, FluxBox or OpenBox I have always had some dependence on the system tray, which annoyed me a lot.

Some of them things that I liked a system tray for were a static clock that was always in the same spot and I could always look down and see it, also it had a few nice little icons over there for me to use at my will, like for instance, Gmail-Notify which is a little systray applet that will tell you if you have gmail or not and give you a little pop-up if you get new mail. Also this was for a while how i was telling if I had a new message in pidgin.

Then I started thinking to myself,

“All of these things could be done with Conky and I could use Conky for even more.”

So began the transformation.

If you don’t know already what Conky is, it is a little application that will put text in any format and of almost any type of data you want, weather it be the weather report for the day or the week, or your battery status, the day of the week, or your wireless link quality. It blends into your desktop very well and will give you that sweet geekish look that everybody looks for in a desktop.

First we need to install it.

Gentoo:

emerge -av conky

Make sure that you check out the use flags in Gentoo for things like “wifi” and others

Arch Linux:

pacman -S conky

Ubuntu:

apt-get install conky

Now that you have Conky installed it is time for you to figure out where on your screen you want to put it and also how you want it to look. I wont get into to much detail about how to set it up because those things can be figured out by the most green of Linux users. Also there should be an example config file for Conky that came with the install for Gentoo it is /etc/conky/conky.conf. You need to copy this file to ~/.conkyrc and then edit it at your leisure.

It is quite simple to figure out first you decided the main variables for the program then after the word TEXT you decide how your Conky will look on your desktop. What “text” you would like to see and in what fashion. It is here where you will replace your systray.The first thing I wanted my replacement system tray to display was my gmail messages, weather I had emails or not and how many. So I put together a little script that you can obtain from http://kpstuff.servebeer.com/~admin/check_gmail.sh in order to use this script you need to download it. I suggest to put it into a folder such as ~/scripts/ also make it executable with either “chmod 755 check_gmail.sh” or “chmod +x check_gmail.sh” and remember to edit check_gmail.sh for your username and password. Then you need to edit your ~/.conkyrc file under the TEXT area to resemble this

${texeci 60 ~/scripts/check_gmail.sh}

After this I wanted a clock obviously. Now the time variable has almost a million different options for the format that it gives so I will give you an example of how to set it up but you should run “man strftime” to see a full list of formatting options.

${time %I:%M%p}

This will put a time format on your Conky that resembles “02:19PM”

Yes that is right it is that easy and you can almost print anything you want on Conky even RSS feeds, I suggest you try it out at least once, but not just a little install it and run it and it doesn’t work try.

There are literally hundreds of variables that can be used in Conky and those that are not variables can be created using shell/perl/php/and ruby scripts.

For a list of variables go to http://conky.sourceforge.net/config_settings.html and http://conky.sourceforge.net/variables.html

Thank you once more for your time and remember to leave comments for any of the writers for the Linux blog because each of us would sure appreciate feedback on our writings, whether it be good or bad.

Man Pages for commands in this post »

conky

4 Comments »

303

Comment by Owen

February 7, 2008 @ 9:32 pm

Looks sort of like Torsmo.

678

Comment by Andreas

May 11, 2008 @ 5:43 am

How do you display the pidgin status in conky? I have looked for that on the internet, but haven’t found anything…

679

Comment by Kaleb

May 14, 2008 @ 10:41 pm

I acctualy dont know Andreas. However if you search about writing plugins for pidgin im sure you could write a simple one that would allow for outputting the pidgin status directly to a file

then in conky you could just cat that file then you are all set. other then that i belive pidgin also sends that to dbus somehow as well but im not sure how that works either

my conclusion…keep looking there is a way i just dont know it

680

Comment by Owen

May 15, 2008 @ 8:11 am

@ANDREAS

It should not be too difficult to achieve this. I think that the easiest way as Kaleb stated would be to use a plugin. The DBUS functions look like they could also be used but would require a little more code. Take a look at a Python example: http://developer.pidgin.im/wiki/DbusHowto#Listeningtosignals

Hope this helps,

– Owen.

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>