conky com weather

1. conky com weather

andre
negu

(usa Outra)

Enviado em 09/01/2013 - 13:42h

galerinha!!

estou tentando instalar um weather no meu conky mas esta dando erro vejam:



andre@mika ~ $ conky
Conky: /etc/conky/conky.conf: 40: no such configuration: 'border_margin'
Conky: one or more $endif's are missing
Conky: desktop window (10000a5) is subwindow of root window (14e)
Conky: window type - override
Conky: drawing to created window (0x4600001)
Conky: drawing to double buffer
--2013-01-09 13:33:25-- www.accuweather.com/en/br/sao-paulo/45881/current-weather/45881">http://www.accuweather.com/en/br/sao-paulo/45881/current-weather/45881
Resolving www.accuweather.com (www.accuweather.com)... 200.123.198.144
Connecting to www.accuweather.com (www.accuweather.com)|200.123.198.144|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/etc/conky/accuweather/curr_cond_raw'

[ <=> ] 96.812 103K/s in 0,9s

2013-01-09 13:33:28 (103 KB/s) - `/etc/conky/accuweather/curr_cond_raw' saved [96812]


[1]+ Stopped conky
andre@mika ~ $ wget: no process found
--2013-01-09 13:33:28-- www.accuweather.com/en/br/sao-paulo/45881/current-weather/45881">http://www.accuweather.com/en/br/sao-paulo/45881/current-weather/45881
Resolving www.accuweather.com (www.accuweather.com)... 200.123.198.144
Connecting to www.accuweather.com (www.accuweather.com)|200.123.198.144|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/etc/conky/accuweather/curr_cond_raw'

[ <=> ] 96.784 53,4K/s in 1,8s

2013-01-09 13:33:31 (53,4 KB/s) - `/etc/conky/accuweather/curr_cond_raw' saved [96784]

--2013-01-09 13:33:31-- http://www.accuweather.com/en/br/sao-paulo/45881/daily-weather-forecast/45881
Resolving www.accuweather.com (www.accuweather.com)... 200.123.198.144
Connecting to www.accuweather.com (www.accuweather.com)|200.123.198.144|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/etc/conky/accuweather/first_days_raw'

[ <=> ] 97.674 85,7K/s in 1,1s

2013-01-09 13:33:33 (85,7 KB/s) - `/etc/conky/accuweather/first_days_raw' saved [97674]

--2013-01-09 13:33:33-- http://www.accuweather.com/en/br/sao-paulo/45881/daily-weather-forecast/45881?day=6
Resolving www.accuweather.com (www.accuweather.com)... 200.123.198.144
Connecting to www.accuweather.com (www.accuweather.com)|200.123.198.144|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/etc/conky/accuweather/last_days_raw'

[ <=> ] 96.915 51,6K/s in 1,8s

2013-01-09 13:33:36 (51,6 KB/s) - `/etc/conky/accuweather/last_days_raw' saved [96915]

cp: cannot stat `/home/andre/Conky/htc_home/accuweather/Forecast_Images/18.png': No such file or directory
sed: -e expression #1, char 6: unterminated `s' command
cp: target `/etc/conky/accuweather/6.png' is not a directory
sed: -e expression #1, char 7: unterminated `s' command
cp: target `/etc/conky/accuweather/11.png' is not a directory
sed: -e expression #1, char 7: unterminated `s' command
cp: target `/etc/conky/accuweather/16.png' is not a directory
sed: -e expression #1, char 7: unterminated `s' command
cp: target `/etc/conky/accuweather/21.png' is not a directory
sed: -e expression #1, char 8: unterminated `s' command
cp: target `/etc/conky/accuweather/ton.png' is not a directory
cp: cannot stat `/home/andre/Conky/htc_home/accuweather/Forecast_Images/.png': No such file or directory
cp: cannot stat `/home/andre/Conky/htc_home/accuweather/Forecast_Images/.png': No such file or directory
cp: cannot stat `/home/andre/Conky/htc_home/accuweather/Forecast_Images/.png': No such file or directory
cp: cannot stat `/home/andre/Conky/htc_home/accuweather/Forecast_Images/.png': No such file or directory
Conky: Unable to load image '/etc/conky/accuweather/cc.png'

[1]+ Floating point exceptionconky
andre@mika ~ $


logo abaixo segue o script
===========================================================


SCRIPT WEATHER
#!/bin/bash

#function: test_image_day
test_image_day () {
case $1 in
su)
echo 1su
;;
msu)
echo 2msu
;;
psu)
echo 3psu
;;
ic)
echo 4ic
;;
h)
echo 5h
;;
mc)
echo 6mc
;;
c)
echo 7c
;;
d)
echo 8d
;;
f)
echo 9f
;;
s)
echo 10s
;;
mcs)
echo 11mcs
;;
psus)
echo 12psus
;;
t)
echo 13t
;;
mct)
echo 14mct
;;
psut)
echo 15psut
;;
r)
echo 16r
;;
fl)
echo 17fl
;;
mcfl)
echo 18mcfl
;;
psfl)
echo 19psfl
;;
sn)
echo 20sn
;;
mcsn)
echo 21mcsn
;;
i)
echo 22i
;;
sl)
echo 23sl
;;
fr)
echo 24fr
;;
rsn)
echo 25rsn
;;
w)
echo 26w
;;
ho)
echo 27ho
;;
co)
echo 28co
;;
cl)
echo 29cl
;;
mcl)
echo 31mcl
;;
pc)
echo 32pc
;;
pcs)
echo 36pcs
;;
pct)
echo 38pct
;;
esac
}

#function: test_image_night
test_image_night () {
case $1 in
su)
echo 1su
;;
msu)
echo 2msu
;;
psu)
echo 3psu
;;
c)
echo 7c
;;
d)
echo 8d
;;
f)
echo 9f
;;
s)
echo 10s
;;
psus)
echo 12psus
;;
t)
echo 13t
;;
psut)
echo 15psut
;;
r)
echo 16r
;;
fl)
echo 17fl
;;
psfl)
echo 19psfl
;;
sn)
echo 20sn
;;
i)
echo 22i
;;
sl)
echo 23sl
;;
fr)
echo 24fr
;;
rsn)
echo 25rsn
;;
ho)
echo 27ho
;;
co)
echo 28co
;;
cl)
echo 29cl
;;
w)
echo 30w
;;
mcl)
echo 31mcl
;;
pc)
echo 32pc
;;
ic)
echo 33ic
;;
h)
echo 34h
;;
mc)
echo 35mc
;;
pcs)
echo 36pcs
;;
mcs)
echo 37mcs
;;
pct)
echo 38pct
;;
mct)
echo 39mct
;;
mcfl)
echo 40mcfl
;;
mcsn)
echo 41mcsn
;;
esac
}


#put your Accuweather address here
address="http://www.accuweather.com/en/pt/amadora/274011/weather-forecast/274011"

loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')

curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"
wget -O /etc/conky/accuweather/curr_cond_raw "$curr_addr"

addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
addr2="$addr1"?day=6

kill -STOP $(pidof conky)
killall wget

wget --save-cookies /etc/conky/accuweather/cookie -O /etc/conky/accuweather/curr_cond_raw $curr_addr
wget --load-cookies /etc/conky/accuweather/cookie -O /etc/conky/accuweather/first_days_raw $addr1
wget --load-cookies /etc/conky/accuweather/cookie -O /etc/conky/accuweather/last_days_raw $addr2

#Current Conditions - curr_cond file
if [[ -s /etc/conky/accuweather/curr_cond_raw ]]; then

egrep -i '"detail-tab-panel |>Today<\/a>|>Tonight<\/a>|>Early AM<\/a>|>Overnight<\/a>|>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|var d = '\''|var s = '\''|Humidity: |Pressure: |Cloud Cover: |UV Index: |Dew Point: |Precipitation(1 hr): |Visibility: |am<\/span>|pm<\/span>' /etc/conky/accuweather/curr_cond_raw > /etc/conky/accuweather/curr_cond
sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' -e 's/RealFeel/\n/g' /etc/conky/accuweather/curr_cond
sed -i -e 's/^.*"#">//g' -e 's/^.*<strong class="temp"//g' -e 's/^>//g' -e 's/<span>&deg.*$//g' /etc/conky/accuweather/curr_cond
sed -i -e 's/<\/a>.*$//g' -e 's/\/span> //g' -e 's/var d = //g' -e 's/var s = //g' -e 's/"temp">/\n/g' /etc/conky/accuweather/curr_cond
sed -i -e 's/^.*"start">//g' -e 's/^.*"finish">//g' -e 's/<li>//g' -e 's/<strong>//g' -e 's/<<span.*$//g' /etc/conky/accuweather/curr_cond
sed -i -e 's/<\/span>//g' -e 's/<\/strong><\/li>//g' -e 's/ "><\/div>//g' -e 's/'\''//g' /etc/conky/accuweather/curr_cond
sed -i -e 's/"><\/div>//g' -e 's/^.*; //g' -e 's/&#.*$//g' -e 's/ i-alarm.*$//g' -e 's/;//g' /etc/conky/accuweather/curr_cond
sed -i -e 's/Humidity: //g' -e 's/Pressure: //g' -e 's/Cloud Cover: //g' -e 's/UV Index: //g' -e 's/Dew Point: //g' -e 's/Visibility: //g' /etc/conky/accuweather/curr_cond
sed -i -e 's/^.*detail-tab-panel //g' -e 's/">//g' -e 's/\r//g' -e 's/ *$//g' /etc/conky/accuweather/curr_cond
time=$(sed -n 1p /etc/conky/accuweather/curr_cond)
if [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
sed -i 3a- /etc/conky/accuweather/curr_cond
fi
time=$(sed -n 26p /etc/conky/accuweather/curr_cond)
image=$(sed -n 27p /etc/conky/accuweather/curr_cond)
if [[ $time == day ]]; then
sed -i 27s/$image/$(test_image_day $image)/ /etc/conky/accuweather/curr_cond
elif [[ $time == night ]]; then
sed -i 27s/$image/$(test_image_night $image)/ /etc/conky/accuweather/curr_cond
fi
cp $HOME/Conky/htc_home/accuweather/Forecast_Images/$(sed -n 27p /etc/conky/accuweather/curr_cond).png /etc/conky/accuweather/cc.png
fi


#First 5days - first_days file
if [[ -s /etc/conky/accuweather/first_days_raw ]]; then

egrep -i '>Today<|<p>[a-z]|>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|realfeel">RealFeel|realfeel">Precipitation' /etc/conky/accuweather/first_days_raw > /etc/conky/accuweather/first_days
sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' /etc/conky/accuweather/first_days
sed -i -e 's/ "><\/div>//g' -e 's/"><\/div>//g' -e 's/^.*"temp">//g' -e 's/<span>&deg.*$//g' /etc/conky/accuweather/first_days
sed -i -e 's/<p>//g' -e 's/<\/p>//g' -e 's/^.*"#">//g' -e 's/\/span> //g' -e 's/^.*>Precipitation //g' -e 's/^.*; //g' /etc/conky/accuweather/first_days
sed -i -e 's/&#.*$//g' -e 's/<.*$//g' -e 's/ i-alarm.*$//g' -e 's/\r//g' -e 's/ *$//g' /etc/conky/accuweather/first_days
sed -i -e 's/Today/TODAY/' -e 's/Mon/MON/' -e 's/Tue/TUE/' -e 's/Wed/WED/' -e 's/Thu/THU/' -e 's/Fri/FRI/' -e 's/Sat/SAT/' -e 's/Sun/SUN/' /etc/conky/accuweather/first_days
time=$(sed -n 1p /etc/conky/accuweather/curr_cond)
if [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
sed -i 2a- /etc/conky/accuweather/first_days
fi
L1=$(sed -n 1p /etc/conky/accuweather/first_days)
if [[ $L1 == TODAY ]]; then
sed -i 1d /etc/conky/accuweather/first_days
fi
for (( i=6; i<=21; i+=5 ))
do
image_raw=$(sed -n "${i}"p /etc/conky/accuweather/first_days)
sed -i ${i}s/$image_raw/$(test_image_day $image_raw)/ /etc/conky/accuweather/first_days
cp $HOME/Conky/htc_home/accuweather/Forecast_Images/$(sed -n ${i}p /etc/conky/accuweather/first_days).png /etc/conky/accuweather/$i.png
done
image_raw=$(sed -n 25p /etc/conky/accuweather/first_days)
sed -i 25s/$image_raw/$(test_image_day $image_raw)/ /etc/conky/accuweather/first_days
cp $HOME/Conky/htc_home/accuweather/Forecast_Images/$(sed -n 25p /etc/conky/accuweather/first_days).png /etc/conky/accuweather/tod.png
image_raw=$(sed -n 30p /etc/conky/accuweather/first_days)
sed -i 30s/$image_raw/$(test_image_day $image_raw)/ /etc/conky/accuweather/first_days
cp $HOME/Conky/htc_home/accuweather/Forecast_Images/$(sed -n 30p /etc/conky/accuweather/first_days).png /etc/conky/accuweather/ton.png

fi


#Last 5days - last_days file
if [[ -s /etc/conky/accuweather/last_days_raw ]]; then

egrep -i '>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|realfeel">RealFeel|realfeel">Precipitation' /etc/conky/accuweather/last_days_raw > /etc/conky/accuweather/last_days
sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' /etc/conky/accuweather/last_days
sed -i -e 's/ "><\/div>//g' -e 's/"><\/div>//g' -e 's/^.*"temp">//g' -e 's/<span>&deg.*$//g' /etc/conky/accuweather/last_days
sed -i -e 's/^.*"#">//g' -e 's/\/span> //g' -e 's/^.*>Precipitation //g' -e 's/^.*; //g' /etc/conky/accuweather/last_days
sed -i -e 's/&#.*$//g' -e 's/<.*$//g' -e 's/ i-alarm.*$//g' -e 's/\r//g' -e 's/ *$//g' /etc/conky/accuweather/last_days
sed -i -e 's/Mon/MON/' -e 's/Tue/TUE/' -e 's/Wed/WED/' -e 's/Thu/THUR/' -e 's/Fri/FRI/' -e 's/Sat/SAT/' -e 's/Sun/SUN/' /etc/conky/accuweather/last_days
for (( i=2; i<=22; i+=5 ))
do
image_raw=$(sed -n "${i}"p /etc/conky/accuweather/last_days)
sed -i ${i}s/$image_raw/$(test_image_day $image_raw)/ /etc/conky/accuweather/last_days
cp $HOME/Conky/htc_home/accuweather/Forecast_Images/$(sed -n ${i}p /etc/conky/accuweather/last_days).png /etc/conky/accuweather/last_$i.png
done

fi

#messages file
sed -n 28p /etc/conky/accuweather/curr_cond | cut -c -20 > /etc/conky/accuweather/messages
sed -n 29p /etc/conky/accuweather/first_days | cut -c -20 >> /etc/conky/accuweather/messages
sed -n 34p /etc/conky/accuweather/first_days | cut -c -20 >> /etc/conky/accuweather/messages
for (( i=7; i<=22; i+=5 ))
do
sed -n ${i}p /etc/conky/accuweather/first_days | cut -c -20 >> /etc/conky/accuweather/messages
done
for (( i=3; i<=23; i+=5 ))
do
sed -n ${i}p /etc/conky/accuweather/last_days | cut -c -20 >> /etc/conky/accuweather/messages
done

kill -CONT $(pidof conky)

=================================================================

os arquivos estão nos diretorios certos vejam!!

mika accuweather # ls
accuw_script cookie curr_cond curr_cond_raw first_days first_days_raw Forecast_Images last_7.png last_days last_days_raw messages tod.png
mika accuweather # cd ..
mika conky # ls
accuweather conky.conf conky.conf.orig conky_no_x11.conf images scripts
mika conky # pwd
/etc/conky

####################################
mika andre # ls
Área de Trabalho Conky Documentos Downloads Imagens Modelos Música Público start_conky.sh Vídeos
mika andre # pwd
/home/andre
mika andre #

############################################


sera que vocês poderiam me ajudar?





  


2. Re: conky com weather

Leandro Nkz
leandro

(usa Arch Linux)

Enviado em 09/01/2013 - 18:08h

Poste de onde você baixou o aplicativo (accuweather), ou o Conky já veio com ele?

Se preferir, você também pode usar o BrWeather: http://brweatherproject.blogspot.com.br/2012/06/instalacao-do-brweather.html ;)

Abraço.


3. Re: conky com weather

andre
negu

(usa Outra)

Enviado em 09/01/2013 - 18:37h

isso é um site!!!

www.accuweather.com é aqui que pega as definições


4. Re: conky com weather

Leandro Nkz
leandro

(usa Arch Linux)

Enviado em 09/01/2013 - 18:42h

negu escreveu:

isso é um site!!!

www.accuweather.com é aqui que pega as definições


Você não me entendeu. De onde você baixou o aplicativo que pega as definições? Eu quero instalar aqui para testar.

Abraço.


5. Re: conky com weather

andre
negu

(usa Outra)

Enviado em 09/01/2013 - 18:45h

aaaaaahhhhhhh
rsrsrsrs

é tudo em script, peguei no devianartm quer que eu poste os scripts?


6. Re: conky com weather

andre
negu

(usa Outra)

Enviado em 09/01/2013 - 18:46h

ai é só instalar o conky e rodar os scripts, fazer uma copia do conky.config que fica dentro de /etc/conky


7. Re: conky com weather

Leandro Nkz
leandro

(usa Arch Linux)

Enviado em 09/01/2013 - 18:49h

Tem certeza de que não há nenhuma pasta com imagens?

É isso que a mensagem de erro está apontando:

cp: cannot stat `/home/andre/Conky/htc_home/accuweather/Forecast_Images/18.png': No such file or directory
sed: -e expression #1, char 6: unterminated `s' command
cp: target `/etc/conky/accuweather/6.png' is not a directory
sed: -e expression #1, char 7: unterminated `s' command
cp: target `/etc/conky/accuweather/11.png' is not a directory
sed: -e expression #1, char 7: unterminated `s' command
cp: target `/etc/conky/accuweather/16.png' is not a directory
sed: -e expression #1, char 7: unterminated `s' command
cp: target `/etc/conky/accuweather/21.png' is not a directory
sed: -e expression #1, char 8: unterminated `s' command
cp: target `/etc/conky/accuweather/ton.png' is not a directory
cp: cannot stat `/home/andre/Conky/htc_home/accuweather/Forecast_Images/.png': No such file or directory
cp: cannot stat `/home/andre/Conky/htc_home/accuweather/Forecast_Images/.png': No such file or directory
cp: cannot stat `/home/andre/Conky/htc_home/accuweather/Forecast_Images/.png': No such file or directory
cp: cannot stat `/home/andre/Conky/htc_home/accuweather/Forecast_Images/.png': No such file or directory
Conky: Unable to load image '/etc/conky/accuweather/cc.png'


Deveria existir a pasta "/home/andre/Conky/htc_home/accuweather/Forecast_Images/" contendo imagens das previsões.

Abraço.


8. Re: conky com weather

andre
negu

(usa Outra)

Enviado em 09/01/2013 - 18:52h

um exemplo http://wgacton.deviantart.com/art/Conky-htc-home-clone-v2-0-267204055


9. Re: conky com weather

andre
negu

(usa Outra)

Enviado em 09/01/2013 - 18:53h

baixa este que é melhor!!

http://beslayed.deviantart.com/art/Steamy-Conky-on-Ubuntu-11-04-214491083


10. Re: conky com weather

andre
negu

(usa Outra)

Enviado em 09/01/2013 - 19:03h

eu tenho as pastas


andre@mika ~/Conky $ du -h
116K ./htc_home/images
1,2M ./htc_home/accuweather/Forecast_Images
1,2M ./htc_home/accuweather
1,3M ./htc_home
1,4M .
andre@mika ~/Conky $


andre@mika ~/Conky/htc_home/accuweather/Forecast_Images $ ls
10s.png 16r.png 21mcsn.png 27ho.png 32pc.png 38pct.png 5h.png
11mcs.png 17fl.png 22i.png 28co.png 33ic.png 39mct.png 6mc.png
12psus.png 18mcfl.png 23sl.png 29cl.png 34h.png 3psu.png 7c.png
13t.png 19psfl.png 24fr.png 2msu.png 35mc.png 40mcfl.png 8d.png
14mct.png 1su.png 25rsn.png 30w.png 36pcs.png 41mcsn.png 9f.png
15psut.png 20sn.png 26w.png 31mcl.png 37mcs.png 4ic.png
andre@mika ~/Conky/htc_home/accuweather/Forecast_Images $



===========================================
andre@mika /etc/conky $ du -h
116K ./images
1,2M ./accuweather/Forecast_Images
1,6M ./accuweather
12K ./scripts
1,7M .
andre@mika /etc/conky $

andre@mika /etc/conky/accuweather/Forecast_Images $ ls
10s.png 16r.png 21mcsn.png 27ho.png 32pc.png 38pct.png 5h.png
11mcs.png 17fl.png 22i.png 28co.png 33ic.png 39mct.png 6mc.png
12psus.png 18mcfl.png 23sl.png 29cl.png 34h.png 3psu.png 7c.png
13t.png 19psfl.png 24fr.png 2msu.png 35mc.png 40mcfl.png 8d.png
14mct.png 1su.png 25rsn.png 30w.png 36pcs.png 41mcsn.png 9f.png
15psut.png 20sn.png 26w.png 31mcl.png 37mcs.png 4ic.png
andre@mika /etc/conky/accuweather/Forecast_Images $





11. Re: conky com weather

Leandro Nkz
leandro

(usa Arch Linux)

Enviado em 09/01/2013 - 19:46h

Os conkys dos links que você passou utilizam outro programa de tempo: o ConkyForecast.

E, o erro que você mostrou no tópico é do programa Accuweather.

Qual é o link do Conky que está apresentando erro? Ou você quer trocar de Conky?



12. Re: conky com weather

andre
negu

(usa Outra)

Enviado em 09/01/2013 - 20:08h

esse Accuweather é um site que tem as previsoes, não é um programa.



01 02



Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts