How to Create A Minimal And Beautiful Desktop With Conky

Conky is a simple, lightweight system monitor application that can display information on your desktop and allows you to monitor several processes simultaneously. For those who like to keep a minimal desktop, but still want to have quick access to various information such as emails, weather, memory usage etc, then Conky is just the application for you.

conky-screenshot

While the installation of Conky is easy, configuring it can be a rather troublesome task. Follow this tutorial closely and I am sure you’ll master the trick in no time.

Install Conky

Click here to install Conky on your Ubuntu machine. Alternatively, open your terminal (Applications -> Accessories -> Terminal) and type:

sudo apt-get install conky

Once the installation is completed, type in the terminal:

zcat /usr/share/doc/conky/examples/conky.conf.gz > ~/.conkyrc

To test if conky is working, in the terminal, type

conky

A window will pop up showing all your system information. Other than the background which is your own wallpaper, the information will be the same as the one shown in the image below.

conky-window
(Click to enlarge)

Close the conky window. We are now going to configure it to display the information that we want and also to change its color to match those of your wallpaper.

Configuring Conky

Go to your Home folder (Places -> Home). Press Ctrl + H to show hidden files. Scroll down till you found the file .conkyrc. Double click to open it in Text editor. This is the main config file that will affect what is showing on your desktop.

Scroll down the list and make sure the following configuration are set properly. Make sure that these settings do not have a ‘#’ in front. If yes, remove them.

background yes
use_xft yes
xftfont Bitstream Vera Sans Mono:size=8
xftalpha 0.8
update_interval 5.0
total_run_times 0
own_window no
own_window_type desktop
own_window_transparent yes
own_window_colour black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 280 5
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no
stippled_borders 8
border_margin 4
border_width 1
default_color white
default_shade_color black
default_outline_color black
alignment top_right
gap_x 12
gap_y 12
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale no
use_spacer none
text_buffer_size 1024
override_utf8_locale yes

The above configurations are the default setting that I used in my system. When you are more familiar with it, you can change it to suit your needs. When you are done with the configuration setting, leave this aside for a while. We will get back to it later.

Installing the Mail and Weather Forecast package for Conky

We need to install additional package in order for Conky to display new mail and weather forecast on your desktop.

In your terminal,

gksu gedit /etc/apt/sources.list

Add the following line to the end of the file.

deb http://ppa.launchpad.net/m-buck/ubuntu hardy main

Save and close.

Back to your terminal,

sudo apt-get update
sudo apt-get install conkyemail conkyforecast

Configuring Weather Forecast

Now, go to Weather.com and sign up a partner account. This will enable you to enquire the weather information in your city.

weather-signup

Once you have signed up, check your mailbox for the confirmation email. Scroll down the mail until you see your Partner ID and License key.

weather-key

Back to your terminal,

sudo cp /usr/share/conkyforecast/conkyForecast.config ~/.conkyForecast.config
gedit ~/.conkyForecast.config

Fill in the XOAP_Partner_ID and XOAP_License_key fields with the information from the confirmation email. Save and exit.

On your browser, go to http://xoap.weather.com/search/search?where=YOUR_CITY and replace YOUR_CITY with the name of your city. You will see a xml similar to the image below. Record down the id. This is the identifier for your city and you will need it later on.

weather.com xml file

Putting all together

Back to your .conkyrc file, scroll down to until you see the line

# stuff after ‘TEXT’ will be formatted on screen
TEXT

As stated in the statement, anything that is placed under the word TEXT will be displayed on the screen. There is a certain syntax that you need to follow to get it to display correctly and beautifully.

The following is my configuration . You are free to copy and modify.

TEXT
${font Radio Space:size=30}${color5}DAMIEN'S PC
${voffset -20}${color1}$hr
${voffset -20}${font Radio Space:size=14}${color1}${time %A %d %Y}
${font Radio Space:size=55}${color1}${time %H:%M}
${voffset -15}${font ConkyWeather:size=36}c ${font Verdana:size=15}${voffset -5}${execi 3600 conkyForecast --location=SNXX0006 --datatype=LT} / ${execi 3600 conkyForecast --location=SNXX0006 --datatype=HT}
$stippled_hr
${font Verdana:style=Bold:size=9}${color1}Yahoo: ${font Verdana:size=8}${execi 600 conkyEmail --servertype=POP --servername=pop.mail.yahoo.com --username=xyz --password=xyz --ssl} new emails
${font Verdana:style=Bold:size=9}${color1}Gmail: ${font Verdana:size=8}${execi 600 conkyEmail --servertype=IMAP --servername=imap.googlemail.com --username=xyz --password=xyz --ssl} new emails
$stippled_hr
${font Verana:style=Bold:size=9}CPU1: ${font Verana:size=8}${cpubar cpu1 10,150} ${cpu cpu1}%
${font Verana:style=Bold:size=9}CPU2: ${font Verana:size=8}${cpubar cpu2 10,150} ${cpu cpu2}%
${font Verana:style=Bold:size=8}Name PID CPU% MEM%
${font Verana:size=8}${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5}
${font Verana:style=Bold:size=9}RAM: ${font Verdana:size=8}${mem} / ${memmax} (${memperc}%)
${font Verana:style=Bold:size=9}SWAP: ${font Verdana:size=8}${swap} / ${swapmax} (${swapperc}%)
$stippled_hr
${font Verana:style=Bold:size=9}IP Address: ${font Verana:size=8}${gw_ip}
${font Verana:style=Bold:size=9}Total Download: ${font Verana:size=8}${totaldown eth1}
${font Verana:style=Bold:size=9}Total Upload: ${font Verana:size=8}${totalup eth1}
${font Verana:style=Bold:size=9}Up Speed: ${font Verdana:size=8}${upspeed eth1} Kb/s ${font Verana:style=Bold:size=9}Down Speed: ${font Verdana:size=8}${downspeed eth1} Kb/s
$stippled_hr
${font Verana:style=Bold:size=9}To Do List
${font Verana:size=8}${execi 30 cat /home/damien/TODO.txt}

Some of the commonly used syntax involve:

${font Verdana:style=Bold:size=12} – This means setting the displayed font to Verdana of size 12 and bold. You can modify the font or the size to suit your desktop. A thing to note is that it only supports fonts that are installed in your system. To get new fonts, you can go to dafont.com and download your favorite fonts at no charge at all.

${execi 3600 …} – The execi syntax allows you to execute external scripts. Note that we use the execi syntax to check your email address, weather forecast and also to read a TODO list file and output to the screen. The number behind the execi determines the interval (in sec) for Conky to execute the scripts.

$hr / $stippled_hr - This is to insert a horizontal line in the screen. The $stippled_hr syntax refers to a dotted line.

${execi 3600 conkyForecast –location=SNXX0006 –datatype=LT} – This is the execution code to retrieve Weather information from Weather.com. Note that you need to replace the --location=xyz by your city’s identifier.

${execi 600 conkyEmail –servertype=IMAP –servername=imap.googlemail.com –username=xyz –password=xyz –ssl} – This is the execution code to retrieve information from your Gmail and Yahoo mail account. To enable IMAP service, you will need to enable the IMAP setting in your Gmail account (Settings -> Forwarding and POP/IMAP)

${execi 30 cat /home/damien/TODO.txt} – This is the execution code to read my TODO list file located in my Home folder and display it on the screen

For more information on the syntax, check out the Conky variable site.

Testing out your Conky

When you are done with your setting, in your terminal, type

conky

to get it running, and

killall conky

to terminate it.

Start Conky everytime you log in

Go to System -> Preferences -> Sessions and click Add. Fill in the field as shown below

conky session setting

Conky will now load up automatically next time you log in to your system.

This is a screenshot of my Conky setup. Not really the best, but it does clean up my desktop in an elegant style.

conky-screenshot
Click to enlarge

I am sure you have a much better setup than mine. You can share your conky screenshot by leaving a link in the comment or email me at damien [at] maketecheasier.com

Useful resources