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>°.*$//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>°.*$//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>°.*$//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?