Conky Weather Script (Wetter in Conky anzeigen)

Um Wetterdaten in Conky anzuzeigen bzw. einzubinden, habe ich eine sehr lange Zeit das in den Ubuntu Repos verfügbare Paket “conkyWeather” (so ähnlich müsste der Name von dem Paket gewesen sein) benutzt. Leider ist dieses Paket schon länger nicht mehr in den Repos und ich musste mich nach einer alternativen Möglichkeit umgucken. Andere Wetter-Programme haben mir nicht wirklich gefallen, wegen fehlender Anpassbarkeit und Design. Hier musste wieder Conky herhalten. Dazu habe ich im Crunchbag-Forum ein paar nette Conky Weather Scripts gefunden und ein Design nach meinen Vorstellungen angepasst:

conky_weatherAus dem Forum habe ich das Script 1b1AccuWeather benutzt und etwas modifiziert (minimalistischer).

In der Datei “1b1” muss zunächst einmal der AccuWeather Link für einen bestimmten Ort angepasst werden (ab Zeile 3), hier z.B. für Dortmund:

#put your Accuweather address here
#address="http://www.accuweather.com/en/gr/kastoria/178682/weather-forecast/178682"
address="http://www.accuweather.com/en/de/dortmund/44137/weather-forecast/170370"
#address="http://www.accuweather.com/en/ca/scarborough/m1h/weather-forecast/55049"

In der Datei “.conkyrc_1b1_int” müssen ggf. bestimmte Conky-Optionen angepasst werden (wie z.B. xftfont etc.)

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer yes
use_xft yes

# Update interval in seconds
update_interval 10

# Minimum size of text area
minimum_size 355 300
maximum_width 205

override_utf8_locale yes

# Draw shades?
draw_shades no

# Text stuff
#draw_outline yes # amplifies text if yes
draw_borders no
#font freesans -12
xftfont Verdana:size=8
uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 3

# border margins
border_margin 9

# border width
border_width 10

# Default colors and also border colors, grey90 == #e5e5e5
default_color grey

own_window_colour brown
own_window_transparent yes

# Text alignment, other possible values are commented
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 120
gap_y 600

imlib_cache_size 0
# stuff after 'TEXT' will be formatted on screen

TEXT
${color white}${font Verdana:size=8:bold}// WEATHER $font${hr 1}$color${texeci 500 bash $HOME/1b1_accuweather_images/1b1}${image $HOME/1b1_accuweather_images/cc.png -p 0,50 -s 90x54}
${goto 100}${color white}WIND: $color${alignr}${execpi 600 sed -n '31p' $HOME/1b1_accuweather_images/curr_cond} ${execpi 600 sed -n '32p' $HOME/1b1_accuweather_images/curr_cond}
${goto 25}${execpi 600 sed -n '29p' $HOME/1b1_accuweather_images/curr_cond}°C (${execpi 600 sed -n '30p' $HOME/1b1_accuweather_images/curr_cond}°C)${goto 100}${color white}HUM: $color${alignr}${execpi 600 sed -n '33p' $HOME/1b1_accuweather_images/curr_cond}
${goto 100}${color white}DEW: $color${alignr}${execpi 600 sed -n '37p' $HOME/1b1_accuweather_images/curr_cond}°C
${goto 100}${color white}PR: $color${alignr}${execpi 600 sed -n '34p' $HOME/1b1_accuweather_images/curr_cond}
${goto 100}${color white}VISIB: $color${alignr}${execpi 600 sed -n '38p' $HOME/1b1_accuweather_images/curr_cond}
${goto 100}${color white}CLOUD: $color${alignr}${execpi 600 sed -n '35p' $HOME/1b1_accuweather_images/curr_cond}
${goto 100}${color white}UV: $color${alignr}${execpi 600 sed -n '36p' $HOME/1b1_accuweather_images/curr_cond} 
${color white}${alignr}SUN: $color${execpi 600 sed -n '39p' $HOME/1b1_accuweather_images/curr_cond}/${execpi 600 sed -n '40p' $HOME/1b1_accuweather_images/curr_cond}
${hr 1}
${goto 40}${color white}TODAY${goto 140}TONIGHT$color${image $HOME/1b1_accuweather_images/tod.png -p 0,160 -s 90x54}${image $HOME/1b1_accuweather_images/ton.png -p 105,160 -s 90x54}




${goto 25}${execpi 600 sed -n '26p' $HOME/1b1_accuweather_images/first_days}°C (${execpi 600 sed -n '27p' $HOME/1b1_accuweather_images/first_days}°C)${goto 135}${execpi 600 sed -n '31p' $HOME/1b1_accuweather_images/first_days}°C (${execpi 600 sed -n '32p' $HOME/1b1_accuweather_images/first_days}°C)
${goto 25}Precip: ${execpi 600 sed -n '28p' $HOME/1b1_accuweather_images/first_days}${goto 135}Precip: $color${execpi 600 sed -n '33p' $HOME/1b1_accuweather_images/first_days}
${hr 1}
${goto 35}${color ffe595}${execpi 600 sed -n '5p' $HOME/1b1_accuweather_images/first_days | cut -c1-3}${goto 105}${execpi 600 sed -n '10p' $HOME/1b1_accuweather_images/first_days | cut -c1-3}${goto 175}${execpi 600 sed -n '15p' $HOME/1b1_accuweather_images/first_days | cut -c1-3}$color${image $HOME/1b1_accuweather_images/6.png -p 0,270 -s 63x37}${image $HOME/1b1_accuweather_images/11.png -p 70,270 -s 63x37}${image $HOME/1b1_accuweather_images/16.png -p 140,270 -s 63x37}



${goto 20}${execpi 600 sed -n '8p' $HOME/1b1_accuweather_images/first_days}°C/${execpi 600 sed -n '9p' $HOME/1b1_accuweather_images/first_days}°C${goto 90}${execpi 600 sed -n '13p' $HOME/1b1_accuweather_images/first_days}°C/${execpi 600 sed -n '14p' $HOME/1b1_accuweather_images/first_days}°C${goto 160}${execpi 600 sed -n '18p' $HOME/1b1_accuweather_images/first_days}°C/${execpi 600 sed -n '19p' $HOME/1b1_accuweather_images/first_days}°C

Um verschiedene Conky-Config-Files zu starten, kann man sich ein kleines Start-Script schreiben:

#!/bin/bash
sleep 10 && conky -c /home/user/1b1_accuweather_images/.conkyrc_1b1_int &
sleep 10 && conky -c /home/user/.conkyrc &

One thought on “Conky Weather Script (Wetter in Conky anzeigen)

  1. Martin

    Hello and thank you for sharing your minimalist weather conky script. The only web page I found with reference to the images is on this URL https://bbs.archlinux.org/viewtopic.php?id=139962 and what were once the download links, I believe are no longer live hyperlinks. If you have the images file >1b1_accuweather_images< available, could you please email it to me? Much appreciated & many thanks.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.