A Minimal Configuration of Conky

Conky is what Vista's Sidebar should have been - customizable at every level so that I can count on using as much (or as little) of my resource pool as I would like. It's not a required function by any means, but anyone serious enough to be running some version of Linux is probably someone who refers constantly to some form of a task manager. The OOTB configuration provides basic system information and the list of hotkeys. Grabbing weather forecasts is a popular request, but I couldn't find many start-to-finish discussions that ended with a satisfied user and script. The few such ones that I found were outrageously complicated. If I wanted something that bloated, I'd just run Vista! Below is my own script, which shows a few basic system statistics and works with www.weather.com to grab current stats and forecasts for today and tomorrow. Note that in the evening, the forecast for today is no longer a valid entry on weather.com, so the script returns "N/A" and a high temperature of 0*C (or 32*F).

This does require the user to sign up for an RSS feed with their website, but this service is free. The sign-up page is a little buried; I'm including the link here for completeness. http://www.weather.com/services/xmloap.html

Note that this also requires that the user create a file called ".xoaprc" in the home directory which includes the Partner ID and the License Key on the first line of the file, separated by one space. This ID/Key combo is a personal identifier with the website, so sharing these numbers is not a good idea. Also, the "USIN0624" bit in the weather code is my geographic locale, called the locID. Find yours by using http://xoap.weather.com/search/search?where=[your city] . If the page just looks like a list of cities similar to yours, view the source code for the page to obtain the locID.

Temperatures will automatically be presented in Celsius. Insert the line "temperature_unit fahrenheit" (without quotes) somewhere in the Settings block to convert the temps to Fahrenheit.

In general, the best source for Conky variables and usage is (naturally) the project's home on Sourceforge. The entire variable listing is found here: http://conky.sourceforge.net/variables.html .

My own script looks like this:

# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see:
# http://crunchbanglinux.org/forums/topic/2047/conky-help/
#
# Enjoy! :)
##############################################
# Settings
##############################################
background no
use_xft yes
xftfont URW Gothic L:size=10
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 200 200
maximum_width 240
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color ffffff
#d8d8d8
default_shade_color 000000
default_outline_color d9d7d6
alignment bottom_right
gap_x 12
gap_y 12
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
temperature_unit fahrenheit
##############################################
# Output
##############################################
TEXT
S Y S T E M I N F O
${hr}
#Host:$alignr$nodename
SSID:$alignr${wireless_essid wlan0} ${wireless_link_qual_perc wlan0}%
#Uptime:$alignr$uptime
RAM:$alignr$mem/$memmax
#Swap usage:$alignr$swap/$swapmax
Disk usage:$alignr${fs_used /}/${fs_size /}
CPU usage:$alignr${cpu cpu0}%
$cpubar

${if_gw}
W E A T H E R
${hr}
#$alignr${weather http://xoap.weather.com/weather/local/ USIN0624 icon}
Currently:$alignr${weather http://xoap.weather.com/weather/local/ USIN0624 cloud_cover}
Temp:$alignr${weather http://xoap.weather.com/weather/local/ USIN0624 temperature}*F
RH:$alignr${weather http://xoap.weather.com/weather/local/ USIN0624 humidity}%
#Last Update:$alignr${weather http://xoap.weather.com/weather/local/ USIN0624 last_update}

Today:$alignr${weather_forecast http://xoap.weather.com/weather/local/ USIN0624 0 forecast}
Precip:$alignr${weather_forecast http://xoap.weather.com/weather/local/ USIN0624 0 precipitation}%
H/L:$alignr${weather_forecast http://xoap.weather.com/weather/local/ USIN0624 0 hi}*F/${weather_forecast http://xoap.weather.com/weather/local/ USIN0624 0 low}*F

Tomorrow:$alignr${weather_forecast http://xoap.weather.com/weather/local/ USIN0624 1 forecast}
Precip:$alignr${weather_forecast http://xoap.weather.com/weather/local/ USIN0624 1 precipitation}%
H/L:$alignr${weather_forecast http://xoap.weather.com/weather/local/ USIN0624 1 hi}*F/${weather_forecast http://xoap.weather.com/weather/local/ USIN0624 1 low}*F
${endif}

#S H O R T C U T K E Y S
#${hr}
#Alt+F2$alignr Run Dialog
#Alt+F3$alignr Alt Menu
#Super+Space$alignr Main Menu
#Super+Tab$alignr Client Menu
#Super+t$alignr Terminal
#Super+f$alignr File Manager
#Super+e$alignr Editor
#Super+m$alignr Media Player
#Super+w$alignr Web Browser
#Super+l$alignr Lock Screen
#Super+v$alignr Volume Control
#Super+x$alignr Logout
#PrtSc$alignr Screenshot

Comments

Joshua said…
Weather.com is moving their free service to a series of paid models. Probably should have seen that coming. There are free alternatives out there that work with Conky, but they're more difficult to implement. If I ever get around to fixing that script, I'll post results.
Anonymous said…
We want countdown list!