How can I word wrap this(circled in red)? There is enough space below.
Screenshot-2.png
Here is the relative portion of the conky:
Code:
#### WEATHER ####
${font Arial:bold:size=8.75}${color FFA54F}WEATHER${offset 8}${color 696969}${voffset -2}${hr 2}${font}
${texeci 60 bash /home/davejr/.conky/MyConkyLatest/Accuweather/acc_usa_images}
${goto 145}${voffset -15}$color${font Arial:size=10}${execpi 60 sed -n '3p' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond}${font}
${voffset 13}${goto 145}${color FFA54F}TEMP:$color${alignr}${execpi 60 sed -n '4p' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond}°F
${goto 145}${color FFA54F}WIND:$color${alignr}${execpi 60 sed -n '6p' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond} ${execpi 60 sed -n '14p' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond}
${goto 145}${color FFA54F}HUM:$color${alignr}${execpi 60 sed -n '7p' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond}
${goto 145}${color FFA54F}PRESS:$color${alignr}${execpi 60 sed -n '8p' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond}
${goto 145}${color FFA54F}CLOUD CVR:$color${alignr}${execpi 60 sed -n '9p' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond}
${goto 145}${color FFA54F}UV INDEX:$color${alignr 10}${execpi 60 sed -n '10p' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond}
${goto 145}${color FFA54F}DEW PNT:$color${alignr}${execpi 60 sed -n '11p' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond}
${goto 145}${color FFA54F}VISIB.:$color${alignr}${execpi 60 sed -n '13p' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond}
And the acc_usa_images script:
Code:
#!/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/us/denver-co/80203/weather-forecast/347810?unit=f"
#http://www.accuweather.com/en/us/midway-oh/43151/weather-forecast/2214620"
loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')
kill -STOP $(pidof conky)
killall wget
curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$loc_id"us?day=1
wget -O /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond_raw "$curr_addr"
addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
wget -O /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton_raw "$addr1"
addr2="$addr1"?day=6
wget -O /home/davejr/.conky/MyConkyLatest/Accuweather/last_days_raw "$addr2"
if [[ -s /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond_raw ]]; then
#current conditions
sed -i '/detail-now/,/Moonrise/!d' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond_raw
egrep -i '"cond"|Humidity|Pressure|Cloud Cover|UV Index|Dew Point|Amount of Precipitation|Visibility|AM|PM|mph|icons-wind|detail-tab-panel|icon i-' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond_raw > /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond
sed -i -e 's/^.*icon i-//g' -e 's/^.*tab-panel //g' -e 's/^.*start">//g' -e 's/^.*finish">//g' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond
sed -i 's/^.*<li>//g' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond
sed -i -e 's/<strong>//g' -e 's/<\/strong>//g' -e 's/<\/li>//g' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond
sed -i -e '1d' -e 's/^.*center;">//g' -e 's/^.*icons-wind\///g' -e 's/\.gif.*$//g' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond
sed -i -e 's/^.*"cond">//g' -e 's/temp">/\n/g' -e 's/realfeel">/\n/g' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond
sed -i -e 's/">.*$//g' -e 's/<\/span>.*$//g' -e 's/<span>.*$//g' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond
sed -i -e 's/°//g' -e 's/ //g' -e 's/RealFeel® //g' -e 's/<\/div>.*$//g' -e '15d' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond
sed -i -e 's/Humidity: //g' -e 's/Pressure: //g' -e 's/Cloud Cover: //g' -e 's/UV Index: //g' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond
sed -i -e 's/Dew Point: //g' -e 's/Amount of Precipitation(1 Hr): //g' -e 's/Visibility: //g' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond
sed -i 's/ i-alarm.*$//g' /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond
time=$(sed -n 1p /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond)
image=$(sed -n 2p /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond)
if [[ $time == day ]]; then
sed -i 2s/$image/$(test_image_day $image)/ /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond
elif [[ $time == night ]]; then
sed -i 2s/$image/$(test_image_night $image)/ /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond
fi
cp /home/davejr/.conky/MyConkyLatest/Accuweather/Forecast_Images/$(sed -n 2p /home/davejr/.conky/MyConkyLatest/Accuweather/curr_cond).png /home/davejr/.conky/MyConkyLatest/Accuweather/cc.png
fi
if [[ -s /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton_raw ]]; then
#today - tonight - first 4 days
sed -i '/current first/,/<h4>Night<\/h4>/!d' /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton_raw
egrep -i 'h3|"cond"|temp|icon i-|RealFeel' /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton_raw > /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton
sed -i -e 's/^.*"#">//' -e 's/<\/a>.*$//' /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton
now=$(sed -n 1p /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton)
if [[ $now == Tonight || $now == Overnight ]]; then
sed -i '1s/night/night\n/' /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton
fi
sed -i -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton
sed -i -e '1,21s/^.*"temp">//g' -e 's/^.*"">//g' -e 's/Lo<\/span> /\n/' /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton
sed -i -e '27s/<span>°/\n/' -e 's/<\/a>.*$//g' -e 's/"><.*$//g' -e 's/<\/span><\/span> <span class="realfeel">RealFeel® //g' -e 's/^[ ,\t]*//g' /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton
sed -i -e 's/^ *//g' -e '22s/<span>°/\n/' -e 's/<span>.*$//g' -e 's/<\/span>.*"temp">/\n/' /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton
sed -i -e 's/<\/span>.*$//g' -e 's/°.*$//g' /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton
sed -i -e 's/Tomorrow/TOM./' -e 's/Monday/MON/' -e 's/Tuesday/TUES/' -e 's/Wednesday/WED/' -e 's/Thursday/THURS/' -e 's/Friday/FRI/' -e 's/Saturday/SAT/' -e 's/Sunday/SUN/' /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton
sed -i 's/ i-alarm.*$//g' /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton
for (( i=7; i<=22; i+=5 ))
do
image_raw=$(sed -n "${i}"p /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton)
sed -i ${i}s/$image_raw/$(test_image_day $image_raw)/ /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton
cp /home/davejr/.conky/MyConkyLatest/Accuweather/Forecast_Images/$(sed -n ${i}p /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton).png /home/davejr/.conky/MyConkyLatest/Accuweather/$i.png
done
image_raw=$(sed -n 26p /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton)
sed -i 26s/$image_raw/$(test_image_day $image_raw)/ /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton
cp /home/davejr/.conky/MyConkyLatest/Accuweather/Forecast_Images/$(sed -n 26p /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton).png /home/davejr/.conky/MyConkyLatest/Accuweather/today.png
image_raw=$(sed -n 30p /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton)
sed -i 30s/$image_raw/$(test_image_night $image_raw)/ /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton
cp /home/davejr/.conky/MyConkyLatest/Accuweather/Forecast_Images/$(sed -n 30p /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton).png /home/davejr/.conky/MyConkyLatest/Accuweather/tonight.png
fi
if [[ -s /home/davejr/.conky/MyConkyLatest/Accuweather/last_days_raw ]]; then
#last days
sed -i '/day=6/,/<h4>Night<\/h4>/!d' /home/davejr/.conky/MyConkyLatest/Accuweather/last_days_raw
egrep -i 'h3|"cond"|temp|icon i-|RealFeel' /home/davejr/.conky/MyConkyLatest/Accuweather/last_days_raw > /home/davejr/.conky/MyConkyLatest/Accuweather/last_days
sed -i -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' /home/davejr/.conky/MyConkyLatest/Accuweather/last_days
sed -i -e '1,21s/^.*"temp">//g' -e 's/^.*"#">//g' -e 's/Lo<\/span> /\n/' /home/davejr/.conky/MyConkyLatest/Accuweather/last_days
sed -i -e '27s/<span>°/\n/' -e 's/<\/a>.*$//g' -e 's/"><.*$//g' -e 's/<\/span><\/span> <span class="realfeel">RealFeel® //g' /home/davejr/.conky/MyConkyLatest/Accuweather/last_days
sed -i -e 's/^ *//g' -e '22s/<span>°/\n/' -e 's/<span>.*$//g' -e 's/<\/span>.*"temp">/\n/' /home/davejr/.conky/MyConkyLatest/Accuweather/last_days
sed -i -e 's/<\/span>.*$//g' -e 's/°.*$//g' -e 's/^[ ,\t]*//g' /home/davejr/.conky/MyConkyLatest/Accuweather/last_days
sed -i -e 's/Monday/MON/' -e 's/Tuesday/TUES/' -e 's/Wednesday/WED/' -e 's/Thursday/THURS/' -e 's/Friday/FRI/' -e 's/Saturday/SAT/' -e 's/Sunday/SUN/' /home/davejr/.conky/MyConkyLatest/Accuweather/last_days
sed -i 's/ i-alarm.*$//g' /home/davejr/.conky/MyConkyLatest/Accuweather/last_days
for (( i=2; i<=22; i+=5 ))
do
image_raw=$(sed -n "${i}"p /home/davejr/.conky/MyConkyLatest/Accuweather/last_days)
sed -i ${i}s/$image_raw/$(test_image_day $image_raw)/ /home/davejr/.conky/MyConkyLatest/Accuweather/last_days
cp /home/davejr/.conky/MyConkyLatest/Accuweather/Forecast_Images/$(sed -n ${i}p /home/davejr/.conky/MyConkyLatest/Accuweather/last_days).png /home/davejr/.conky/MyConkyLatest/Accuweather/N$i.png
done
fi
if [[ -s /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton_raw && -s /home/davejr/.conky/MyConkyLatest/Accuweather/last_days_raw ]]; then
#messages - messages_curr
sed -n 27p /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton > /home/davejr/.conky/MyConkyLatest/Accuweather/messages_curr
sed -n 31p /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton >> /home/davejr/.conky/MyConkyLatest/Accuweather/messages_curr
sed -n 8p /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton > /home/davejr/.conky/MyConkyLatest/Accuweather/messages_raw
sed -n 13p /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton >> /home/davejr/.conky/MyConkyLatest/Accuweather/messages_raw
sed -n 18p /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton >> /home/davejr/.conky/MyConkyLatest/Accuweather/messages_raw
sed -n 23p /home/davejr/.conky/MyConkyLatest/Accuweather/tod_ton >> /home/davejr/.conky/MyConkyLatest/Accuweather/messages_raw
sed -n 3p /home/davejr/.conky/MyConkyLatest/Accuweather/last_days >> /home/davejr/.conky/MyConkyLatest/Accuweather/messages_raw
sed -n 8p /home/davejr/.conky/MyConkyLatest/Accuweather/last_days >> /home/davejr/.conky/MyConkyLatest/Accuweather/messages_raw
sed -n 13p /home/davejr/.conky/MyConkyLatest/Accuweather/last_days >> /home/davejr/.conky/MyConkyLatest/Accuweather/messages_raw
sed -n 18p /home/davejr/.conky/MyConkyLatest/Accuweather/last_days >> /home/davejr/.conky/MyConkyLatest/Accuweather/messages_raw
sed -n 23p /home/davejr/.conky/MyConkyLatest/Accuweather/last_days >> /home/davejr/.conky/MyConkyLatest/Accuweather/messages_raw
for (( i=1; i<=4; i++))
do
no=$(sed -n ${i}p /home/davejr/.conky/MyConkyLatest/Accuweather/messages_curr|wc -c)
if (( no<=31 )); then
sed -i $i"s/$/\n/" /home/davejr/.conky/MyConkyLatest/Accuweather/messages_curr
i=$((i+1))
elif (( no>31 )); then
sed -i $i"s/^\(.\{31\}\)/\1\n/" /home/davejr/.conky/MyConkyLatest/Accuweather/messages_curr
i=$((i+1))
fi
done
cat /home/davejr/.conky/MyConkyLatest/Accuweather/messages_raw| cut -c -40 > /home/davejr/.conky/MyConkyLatest/Accuweather/messages
for (( i=1; i<=18; i++))
do
no=$(sed -n ${i}p /home/davejr/.conky/MyConkyLatest/Accuweather/messages|wc -c)
if (( no<=21 )); then
sed -i $i"s/$/\n/" /home/davejr/.conky/MyConkyLatest/Accuweather/messages
i=$((i+1))
elif (( no>21 )); then
sed -i $i"s/^\(.\{21\}\)/\1\n/" /home/davejr/.conky/MyConkyLatest/Accuweather/messages
i=$((i+1))
fi
done
fi
kill -CONT $(pidof conky)
Bookmarks