conky for my desktop

Published April 22nd, 2010 by Chad

At work I have a todo list that I maintain in a simple text file on my system. This todo list looks create and is readable on the command line (using cat) and in vim. However, I was really wanting it in a place where I could see it at a glance.

Also sometimes I miss the Ubuntu notifications in the top right corner of the screen (my background is black and the notifications don’t stand out on a black background since they are also black (I can’t wait until we can easily customize the notification system theme, anyone know how to do that yet?)).>

Another item of information that I love to have visible at all times is the list of my co-workers who are currently online (logged into IM). This helps if I need to ask one of them a quick question.

The solution: Conky

At first conky may scare you, I know it did me. The configuration files have a little bit of a learning curve that may be too steep for some. Conky is mainly used as a “light weight system monitor”. I however don’t need a system monitor (I’ve never really used the information they provide while I am on my desktop computer). System monitors are great for a laptop where I need to worry about what processes might be cramping my speed or draining my battery. I might also use the system monitor to check the temperature of my laptop or the battery level. For my desktop however I don’t need (or want) that stuff. Thankfully conky is so much more than a “light weight system monitor” I can set up scripts to run at any interval I would like and display the output in a nice way in a place where I can (almost) always see it.

Here is my conky configuration file:

background yes
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes

text_buffer_size 1024

use_xft yes
xftfont Inconsolata:size=12
#xftfont Angleterre Book:size=10

alignment top_right
gap_x 20
gap_y 20
maximum_width 400

TEXT

${font Cash Font:bold:size=12}${color #444}TODO:  ${hr 7}

${font}${color gray}${execpi 60 /home/chansen4/conkyTodo.py work}

${font Cash Font:bold:size=12}${color #444}NOTIFICATIONS:  ${hr 7}

${font}${color gray}${execpi 10 /home/chansen4/bin/getLastNotify.py}

${font Cash Font:bold:size=12}${color #444}PEEPS:  ${hr 7}

${execpi 10 conkyPidgin -I co-workers -C C -W U -A A -o -t ~/conkyPidgin.template}

Everything after the “TEXT” is what is displayed (before that are just settings). If you want to change some setting or another you start with the $ (dollar sign) and in {} (curly braces) afterwards specify the property to change and the value to be set.

For example: ${font Cash Font:bold:size=12} sets the font to be the “Cash Font” font, makes it bold and sets the size to 12 point. ${color #444} sets the color to be hex 444. ${hr 7} creates a horizontal rule of 7 pixels thick.

The real interesting part though are the ${execpi commands (the format for these commands is ${execpi [RUN TIME IN SEC] [SCRIPT], not too difficult). This will run an executable script and parse the output at more conky configuration code. There are three such calls in my configuration file. conkyTodo.py (my own script to parse my todo list and display it nicely in conky), getLastNotify.py (once again, my own script to parse the notify-osd.log file to get the last 4 notification messages and display them nicely in conky), and conkyPidgin (which is part of the conky hardcore package and gives one access to the Pidgin contacts).

If any of this is too confusing or you would like some more information/clarification just leave a comment and I will do my best to answer your questions. Thanks!

My current conky theme at work

My current conky theme at work

Update: Here is my getLastNotify.py script.

8 Comments a “conky for my desktop”

  1. 1

    w00t'n'est says:

    Pretty neat stuff man! I’ll have to tinker with this when I get a few minutes :)

    April 22nd, 2010 alle 9:52 am
  1. 2

    Addamaccada says:

    Looks cool, is there any chance of posting your getLastNotify.py script somewhere to put in my config please

    Thanks

    May 3rd, 2010 alle 6:07 pm
  1. 3

    Chad says:

    @addamaccada
    I just updated the post. The script is at the bottom of the post.

    May 11th, 2010 alle 9:16 am
  1. 4

    Addamaccada says:

    Thanks again for making the script available, is there anyway of making notications with #hashtags from being truncated? ie a tweet posted in gwibber, which says “this is a #test of getlastnotify script for conky” only appears as “this is a” in conky.

    June 15th, 2010 alle 6:09 am
  1. 5

    Chad says:

    Great question.
    I just added a single line in the script to escape the #:
    message = parts[1].replace("#", "\#")
    Seemed to work for me.

    June 15th, 2010 alle 1:49 pm
  1. 6

    Addamaccada says:

    That doesn`t seem to work for me, I`m seeing no difference, although I`m not sure where in the script I should be putting the line

    June 20th, 2010 alle 6:54 am
  1. 7

    Chad says:

    Try this updated script.

    June 21st, 2010 alle 8:19 am
  1. 8

    Addamaccada says:

    Cheers, works perfectly now :)

    June 21st, 2010 alle 12:29 pm

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>