Wednesday, June 9, 2010

Setup Multiple conky with build in weather script








This is a report on recreating a complicated multiple conky script without a manual howto set it up.
This is how I did it.First created a folder in home/paul named .conky.
In the folder I put four, later five scripts named .conkyrc1, .conkyrc2, etc.
The content of these scripts I found here
Download the nice and clean conkyscripts here .
Wallpaper found here on Filckr, choose the resolution you want.

When unpacked you will find: conkydate, conkhr, conkymin, conkystats.
Rename these to .conkyrc1 etc and copy to folder .conky.

Conkydate:
background no
use_xft yes
xftfont Helvetica:size=40
xftalpha 0.9
update_interval 3.0
total_run_times 0
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 800
maximum_width 800
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders yes
default_color 808080
default_shade_color 101319
default_outline_color green
alignment top_left
gap_x 400
gap_y 415
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no

TEXT
${color ce2c51}${time %d} ${color ffffff}${time %B}
${time %A}


Conkyhr:
background no
use_xft yes
xftfont Helvetica:size=100
xftalpha 0.9
update_interval 3.0
total_run_times 0
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 170
maximum_width 170
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders yes
default_color 808080
default_shade_color 101319
default_outline_color green
alignment top_left
gap_x 20
gap_y 400
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no

TEXT
${alignr}${color 000000}${time %H}



Conkymin:
background no
use_xft yes
xftfont Helvetica:size=100
xftalpha 0.9
update_interval 3.0
total_run_times 0
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 170
maximum_width 170
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders yes
default_color 808080
default_shade_color 101319
default_outline_color green
alignment top_left
gap_x 195
gap_y 400
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no

TEXT
${color ffffff}${time %M}


Conkystats:
background no
use_xft yes
xftfont Helvetica:size=15
xftalpha 0.9
update_interval 3.0
total_run_times 0
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 800
maximum_width 800
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders yes
default_color 808080
default_shade_color 101319
default_outline_color green
alignment top_left
gap_x 400
gap_y 615
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no

TEXT
${color ce2c51}RAM Usage: CPU Usage: Weather:
${color ffffff}Used: ${mem} Core 1: ${cpu} % ${execi 300 /home/paul/.weather.sh "EUR|NL|NL004|NIJMEGEN"}
From: ${memmax}


So you get a hang of these scripts; the last one will need some extra editing.

The weather script has been placed in and as /home/paul/.weather.sh
It goes like this:
[code]#!/bin/sh
#AccuWeather (r) RSS weather tool for conky
#
#USAGE: weather.sh
#
#(c) Michael Seiler 2007

METRIC=1 #Should be 0 or 1; 0 for F, 1 for C

if [ -z $1 ]; then
echo
echo "USAGE: weather.sh "
echo
exit 0;
fi

curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 | perl -ne 'if (/Currently/) {chomp;/\Currently: (.*)?\<\/title\>/; print "$1"; }' [/code]

The weather.sh needs a rss localization code you will find here:
http://www.accuweather.com/rss-center.asp

Inside the US you can suffice with an easier ZIPcode:
${execi 300 /home/buttons/bin/weather.sh 08534}

More info on the weather script here.

The only thing we still need is to get the multiple conkies working:
#!/bin/bash
sleep 20
conky -c /home/paul/.conky/.conkyrc1 &
conky -c /home/paul/.conky/.conkyrc2 &
conky -c /home/paul/.conky/.conkyrc3 &
conky -c /home/paul/.conky/.conkyrc4 &

fi

Note the sleep delay of 20 seconds; this is done to be sure the internet connection is up and working else you won't have the weather info.
Put the multiconky bash script in usr/bin and put it in the autostart.sh in /home/.config/openbox: multiconky &
Don't forget to make the bash files executable!!

Result full image: http://img99.imageshack.us/img99/1020/2010060912761101201920x.png

Another wallpaper behind it: http://img709.imageshack.us/img709/7298/2010060912761103981920x.png

No comments:

Blog Archive