You are not logged in.
It's been a little over a month since my last accuweather script fix:
https://forums.bunsenlabs.org/viewtopic … 01#p149001
Then three weeks ago, AccuWeather developers changed the server settings and we got 'You don't have permission to access ...':
<HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD><BODY>
<H1>Access Denied</H1>
You don't have permission to access ...If you ask me WHY, I don't know, but I can guess.
The script ended up on a large forum, and then on an even larger one.
It's foolish to think that Accuweather developers didn't notice the increased number of server requests.
I repeat, that's my assumption.
Finally, the daily_forecast and hourly_forecast sections were changed last night.
I realized I was at a crossroads.
After 38 months of maintaining the accuweather script, maybe I should give up, as I've already announced.
My desire was not to be a member of large forums, but to help this small community preserve @TBG's work.
Otherwise, I wouldn't be here now, but there.
Of course, you can still share my code on other forums, but now you know a little more about what can happen.
The next post might be my last about the accuweather script.
It's pointless to fix the script several times a month.
If people would know how little brain is ruling the world, they would die of fear.
Offline
Accuweather Conky Script
Please make a copy of your existing accuweather script first.
SERVER HEADERS
Current Forecast
Replace:
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -H 'access-control-allow-origin: *' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Sec-GPC: 1' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o $HOME/Accuweather_conky_script/curr_cond_raw "$curr_addr"with:
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:147.0) Gecko/20100101 Firefox/147.0' -H 'access-control-allow-origin: *' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.9' --compressed -H 'Connection: keep-alive' -H 'Sec-GPC: 1' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o $HOME/Accuweather_conky_script/curr_cond_raw "$curr_addr"Daily Forecast
Replace:
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -H 'access-control-allow-origin: *' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Sec-GPC: 1' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o $HOME/Accuweather_conky_script/daily_forecast_raw "$daily_addr"with:
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:147.0) Gecko/20100101 Firefox/147.0' -H 'access-control-allow-origin: *' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.9' --compressed -H 'Connection: keep-alive' -H 'Sec-GPC: 1' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o $HOME/Accuweather_conky_script/daily_forecast_raw "$daily_addr"Hourly Forecast
Replace:
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -H 'access-control-allow-origin: *' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o $HOME/Accuweather_conky_script/hourly_raw1 "$hourly_addr1"with:
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:147.0) Gecko/20100101 Firefox/147.0' -H 'access-control-allow-origin: *' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.9' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o $HOME/Accuweather_conky_script/hourly_raw1 "$hourly_addr1"Replace:
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -H 'access-control-allow-origin: *' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o $HOME/Accuweather_conky_script/hourly_raw2 "$hourly_addr2"with:
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:147.0) Gecko/20100101 Firefox/147.0' -H 'access-control-allow-origin: *' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.9' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o $HOME/Accuweather_conky_script/hourly_raw2 "$hourly_addr2"DAILY FORECAST
Replace:
daily_addr="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"with:
# daily_addr="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
daily_addr="$(echo $address|sed 's/weather-forecast.*$//')"10-day-weather-forecast/"$last_number"Replace:
if [[ $forecast2015 == 1 ]]; then
cp $HOME/Accuweather_conky_script/Forecast_Images_2015/$(sed -n ${i}p $HOME/Accuweather_conky_script/daily_forecast).png $HOME/Accuweather_conky_script/forecast_2015/forecast_$j.png
fi
if [[ $forecast2016 == 1 ]]; then
cp $HOME/Accuweather_conky_script/Forecast_Images_2016/$(sed -n ${i}p $HOME/Accuweather_conky_script/daily_forecast).png $HOME/Accuweather_conky_script/forecast_2016/forecast_$j.pngwith:
if [[ $forecast2015 == 1 ]]; then
cp $HOME/Accuweather_conky_script/Forecast_Images_2015/$(sed -n ${i}p $HOME/Accuweather_conky_script/daily_forecast | sed 's/^0*//').png $HOME/Accuweather_conky_script/forecast_2015/forecast_$j.png
fi
if [[ $forecast2016 == 1 ]]; then
cp $HOME/Accuweather_conky_script/Forecast_Images_2016/$(sed -n ${i}p $HOME/Accuweather_conky_script/daily_forecast | sed 's/^0*//').png $HOME/Accuweather_conky_script/forecast_2016/forecast_$j.pngMARENS HOURLY
Part #Icons should now look like this
#Icons
cat $HOME/Accuweather_conky_script/hourly | grep -o '[ ^]src="/images/weathericons/v2a/[^"]*' | awk -F'v2a/' '{print $2}' | sed 's/^0*//' | sed 's/.svg//' > $HOME/Accuweather_conky_script/marens_hourly/iconsWEATHER FONT
I've never used the accuweather script weather font, but I haven't forgotten those who like it.
I guess you need to replace the beginning of #function: test_image:
#function: test_image
test_image () {
case $1 in
1)
echo a
;;
2|3)
echo b
;;
4|5)
echo c
;;
6)
echo d
;;
7)
echo e
;;
8)
echo f
;;with:
#function: test_image
test_image () {
case $1 in
1|01)
echo a
;;
2|02|3|03)
echo b
;;
4|04|5|05)
echo c
;;
6|06)
echo d
;;
7|07)
echo e
;;
8|08)
echo f
;;If people would know how little brain is ruling the world, they would die of fear.
Offline
Hello, thank you for continuing the work of teo, I hope you continue to maintain the script, I have been using this weather for at least 5.6 years, if not more.
PS) If I were able to keep it I would do it but I'm not able to script
Ector
Edit
@Marens I wanted to ask you if you want to, if you posted an already modified accuweather, for the incapable like you I would be grateful, also because if I copy paste in the search in accuweather it does not find the complete line.
If you like, you can send it to me, to my email
Thank you
I do the translation with google translate, hope the translation is correct
Last edited by ector1935 (2026-04-03 10:30:02)
Offline
Thanks @marens for all your maintenance and development work on @TGB's accuweather script. The changes you made have always been 'spot-on'.
Sorry to see these may have been your last - but understand your intentions.
Last edited by ceeslans (2026-04-03 12:11:57)
Offline
@ector1935
I'm sorry, but the accuweather script I use is modified and different from the original one.
You can find the script you are looking for here:
https://forums.linuxmint.com/viewtopic. … 0#p2753540
You need to change the paths and address (your location).
Then you first need to do this:
https://forums.bunsenlabs.org/viewtopic … 01#p149001
After that, make the changes from yesterday (post above).
Tip:
No need to search for the entire line in a text editor.
A small part of the line is enough.
Example from my post above (find it first):
-o $HOME/Accuweather_conky_script/curr_cond_raw "$curr_addr"When you find it in the text editor, check if the rest of the line is the same.
Good luck!
If people would know how little brain is ruling the world, they would die of fear.
Offline
@ceeslans
Thanks.
As I said before, it's pointless to fix a script several times a month.
If Accuweather developers continue to make frequent changes... that's the end.
I still use Gis Weather.
The TAD script is also working well for now.
If people would know how little brain is ruling the world, they would die of fear.
Offline
@marens
Thanks for this latest - possibly final - round of fixes to the Acc conky script. You've helped so much over these past few years, and I can understand how tiresome it is to keep trying to work around Accuweather's website changes every few months. I'm of course sad because it's likely these fixes won't last long, but you've earned your rest.
Last edited by asqwerth (2026-04-03 13:23:50)
Offline
^ Thanks.
I don't know if you've noticed that the site has switched to a new set of icons, which we talked about at the end of last year:
https://forums.bunsenlabs.org/viewtopic.php?id=9641
I still like the old ones (2015, 2016). ![]()
If people would know how little brain is ruling the world, they would die of fear.
Offline
Hi,
@marens, thanks for replying.
I don't understand the link to Mint?
Up until 4 days ago, the AccuWeather I use was working.
This is the script I use, which I fixed when you made updates over the past few months, in @Teo's topic.
#!/usr/bin/env bash
#########################################################################################
# Put the command that launches the conky configuration file that uses this script here #
#########################################################################################
weather_conky_launch_command="conky -b"
#####################################
# Put your Accuweather address here #
#####################################
#address="https://www.accuweather.com/en/us/new-york/10021/weather-forecast/349727"
#address="https://www.accuweather.com/en/ar/buenos-aires/7894/weather-forecast/7894"
#address="https://www.accuweather.com/en/us/hutto/78634/weather-forecast/2110192"
#address="https://www.accuweather.com/en/gr/kastoria/178682/weather-forecast/178682"
#address="https://www.accuweather.com/en/de/lichtenstein/09350/weather-forecast/171261"
#address="https://www.accuweather.com/en/aq/casey-station/2273690/weather-forecast/2273690"
#
#
#
address="https://www.accuweather.com/en/it/gorlago/2277856/weather-forecast/2277856"
#
#
#Pause weather conky
pkill -STOP -xf "$weather_conky_launch_command"
#function: test_image
test_image () {
case $1 in
1)
echo a
;;
2|3)
echo b
;;
4|5)
echo c
;;
6)
echo d
;;
7)
echo e
;;
8)
echo f
;;
11)
echo 0
;;
12)
echo h
;;
13|14)
echo g
;;
15)
echo m
;;
16|17)
echo k
;;
18)
echo i
;;
19)
echo q
;;
20|21|23)
echo o
;;
22)
echo r
;;
24|31)
echo E
;;
25)
echo v
;;
26)
echo x
;;
29)
echo y
;;
30)
echo 5
;;
32)
echo 6
;;
33)
echo A
;;
34|35)
echo B
;;
36|37)
echo C
;;
38)
echo D
;;
39|40)
echo G
;;
41|42)
echo K
;;
43|44)
echo O
;;
*)
echo -
;;
esac
}
#function: test_wind
test_wind () {
case $1 in
CLM)
echo \-
;;
S)
echo 1
;;
SSW)
echo 2
;;
SW)
echo 3
;;
WSW)
echo 4
;;
W)
echo 5
;;
WNW)
echo 6
;;
NW)
echo 7
;;
NNW)
echo 8
;;
N)
echo 9
;;
NNE)
echo \:
;;
NE)
echo \;
;;
ENE)
echo \<
;;
E)
echo \=
;;
ESE)
echo \>
;;
SE)
echo \?
;;
SSE)
echo \@
;;
esac
}
############################
# Check the user arguments #
############################
if (( $# < 1 || $# > 18 )); then
echo "Invalid arguments!"
exit
fi
forecast0=0
forecast2015=0
forecast2016=0
hourly0=0
hourly2015=0
hourly2016=0
h_24hours=1
h_real=1
h_uv=1
h_wind=1
h_wind_g=1
h_hum=1
h_ind_hum=1
h_dew=1
h_cl_cov=1
h_prec_am=1
h_visib=1
h_cl_ceil=1
for i in $*
do
if [[ $i != -f && $i != -f2015 && $i != -f2016 && $i != -h && $i != -h2015 && $i != -h2016 && $i != -h_12h && $i != -h_no_real && $i != -h_no_uv && $i != -h_no_wind && $i != -h_no_wind_g && $i != -h_no_hum && $i != -h_no_ind_hum && $i != -h_no_dew && $i != -h_no_cl_cov && $i != -h_no_prec_am && $i != -h_no_visib && $i != -h_no_cl_ceil ]]; then
echo "Invalid arguments!"
exit
fi
case $i in
-f)
forecast0=1
;;
-f2015)
forecast2015=1
;;
-f2016)
forecast2016=1
;;
-h)
hourly0=1
;;
-h2015)
hourly2015=1
;;
-h2016)
hourly2016=1
;;
-h_12h)
h_24hours=0
;;
-h_no_real)
h_real=0
;;
-h_no_uv)
h_uv=0
;;
-h_no_wind)
h_wind=0
;;
-h_no_wind_g)
h_wind_g=0
;;
-h_no_hum)
h_hum=0
;;
-h_no_ind_hum)
h_ind_hum=0
;;
-h_no_dew)
h_dew=0
;;
-h_no_cl_cov)
h_cl_cov=0
;;
-h_no_prec_am)
h_prec_am=0
;;
-h_no_visib)
h_visib=0
;;
-h_no_cl_ceil)
h_cl_ceil=0
;;
esac
done
if [[ $forecast0 == 1 ]]; then
forecast2015=0
forecast2016=0
fi
if [[ $hourly0 == 1 ]]; then
hourly2015=0
hourly2016=0
fi
last_number=$(echo $address|sed 's/^.*\///')
#############################################################
# NORMAL FORECAST: -f, -f2015 or -f2016 passed as arguments #
#############################################################
if [[ $forecast0 == 1 || $forecast2015 == 1 || $forecast2016 == 1 ]]; then
#function: convert_time
convert_time ()
{
hours=$(echo $1|awk -F ":| " '{print $1}')
minutes=$(echo $1|awk -F ":| " '{print $2}')
am_or_pm=$(echo $1|awk -F ":| " '{print $3}')
if [[ $am_or_pm == "" ]]; then
echo $1
return 0
elif [[ $am_or_pm == AM ]]; then
if (( $hours < 10 )); then
hours_24=0$hours
fi
if (( $hours == 10 || $hours == 11 )); then
hours_24=$hours
fi
if (( $hours == 12 )); then
hours_24=00
fi
elif [[ $am_or_pm == PM ]]; then
if (( $hours != 12 )); then
hours_24=$((hours+12))
fi
if (( $hours == 12 )); then
hours_24=12
fi
fi
time_24=$hours_24:$minutes
if [[ $1 != "N/A" ]]; then
echo $time_24
elif [[ $1 == "N/A" ]]; then
echo "N/A"
fi
}
sleep 0.2
curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o $HOME/Accuweather_conky_script/curr_cond_raw "$curr_addr"
daily_addr="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o $HOME/Accuweather_conky_script/daily_forecast_raw "$daily_addr"
##### del image forecast
if [[ $forecast2015 == 1 ]]; then
if [[ -f $HOME/Accuweather_conky_script/forecast_2015/forecast_*.png ]]; then
rm $HOME/Accuweather_conky_script/forecast_2015/forecast_*.png
fi
fi
if [[ $forecast2016 == 1 ]]; then
if [[ -f $HOME/Accuweather_conky_script/forecast_2016/forecast_*.png ]]; then
rm $HOME/Accuweather_conky_script/forecast_2016/forecast_*.png
fi
fi
sleep 0.2
#current conditions
if [[ -s $HOME/Accuweather_conky_script/curr_cond_raw ]]; then
# # sed '/current-weather-card card-module content-module non-ad/,/glacier-ad /!d' $HOME/Accuweather_conky_script/curr_cond_raw > $HOME/Accuweather_conky_script/curr_cond_temp
sed '/current-weather-card/,/glacier-ad /!d' $HOME/Accuweather_conky_script/curr_cond_raw > $HOME/Accuweather_conky_script/curr_cond_temp
sed -i '/div class=\"label-tooltip\" data-js/,/div class=\"current-weather-details/d' $HOME/Accuweather_conky_script/curr_cond_temp
sed -i -e 's/\.svg.*$//g' -e 's/<\/div>//g' -e 's/<div>//g' -e 's/<\/span>//g' -e 's/<span class.*$//g' -e 's/^[\t]*//g' $HOME/Accuweather_conky_script/curr_cond_temp
#sed -i -e 's/.*weathericons\///' -e 's/^.*>//g' -e 's/°.*$//g' -e 's/.*RealFeel® //g' -e '/RealFeel Shade™/,+1d' -e '/Indoor Humidity/,+1d' -e '/^$/d' $HOME/Accuweather_conky_script/curr_cond_temp
sed -i -e 's/.*weathericons\///' -e 's/^.*>//g' -e 's/°.*$//g' -e '/RealFeel®/d' -e '/RealFeel Shade™/,+1d' -e '/RealFeel Shade/,+1d' -e '/Indoor Humidity/,+1d' -e '/^$/d' $HOME/Accuweather_conky_script/curr_cond_temp
#
sed -i '1s/^0//' $HOME/Accuweather_conky_script/curr_cond_temp
# temporary file to control
#
cp $HOME/Accuweather_conky_script/curr_cond_temp $HOME/Accuweather_conky_script/curr_cond_control_point
if [[ $(sed -n 5p $HOME/Accuweather_conky_script/curr_cond_temp) != 'Max UV Index' ]]; then
sed -i "5s/^/Max UV\n0\n/" $HOME/Accuweather_conky_script/curr_cond_temp
fi
wind_dir=$(sed -n 8p $HOME/Accuweather_conky_script/curr_cond_temp|head -c 1)
if [[ $wind_dir == 0 ]]; then
sed -i '8s/^/CLM /' $HOME/Accuweather_conky_script/curr_cond_temp
fi
sed -i '8s/ /\n/1' $HOME/Accuweather_conky_script/curr_cond_temp
# sed '/sunrise-sunset card-module content-module/,/temp-history content-module/!d' $HOME/Accuweather_conky_script/curr_cond_raw > $HOME/Accuweather_conky_script/curr_cond_temp1
sed '/sunrise-sunset/,/temp-history content-module/!d' $HOME/Accuweather_conky_script/curr_cond_raw > $HOME/Accuweather_conky_script/curr_cond_temp1
sed -i -e 's/.*"text-value">//g' -e 's/<\/span>$//g' -e '/</d' $HOME/Accuweather_conky_script/curr_cond_temp1
#
sed -i -e '1d;4d' -e 's/^[\t]*//g' -e 's/ AM/:AM/g' -e 's/ PM/:PM/g' -e 's/ .*$//g' -e '/^$/d' -e 's/:AM/ AM/g' -e 's/:PM/ PM/g' $HOME/Accuweather_conky_script/curr_cond_temp1
sed -i -e '1N;s/\n/:/' $HOME/Accuweather_conky_script/curr_cond_temp1
if [[ $(sed -n 4p $HOME/Accuweather_conky_script/curr_cond_temp1) != "N/A" && $(sed -n 5p $HOME/Accuweather_conky_script/curr_cond_temp1) != "N/A" && $(sed -n 6p $HOME/Accuweather_conky_script/curr_cond_temp1) != "N/A" && $(sed -n 7p $HOME/Accuweather_conky_script/curr_cond_temp1) != "N/A" ]]; then
sed -i '4N;s/\n/:/' $HOME/Accuweather_conky_script/curr_cond_temp1
fi
# sorting сортировка
# curr_cond line 1,2 номер изобр. облака и температуры сейчас , number icon and Temperature now
sed -n 1,2p $HOME/Accuweather_conky_script/curr_cond_temp > $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 3 температура ощущение Real Feel
sed -n 4p $HOME/Accuweather_conky_script/curr_cond_temp >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 4 облачность Forecast
sed -n 3p $HOME/Accuweather_conky_script/curr_cond_temp >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 5 направление ветра Wind Direction
sed -n 8p $HOME/Accuweather_conky_script/curr_cond_temp >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 6 скорость ветра Wind Speed
#
sed -n 9p $HOME/Accuweather_conky_script/curr_cond_temp >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 7 влажность Humidity
sed -n 13p $HOME/Accuweather_conky_script/curr_cond_temp >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 8 давление Pressure
sed -n 17p $HOME/Accuweather_conky_script/curr_cond_temp >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 9 УФ индекс UV Index
sed -n 6p $HOME/Accuweather_conky_script/curr_cond_temp >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 10 облачность Cloud Cover
sed -n 19p $HOME/Accuweather_conky_script/curr_cond_temp >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 11 влажность Indoor Humidity (for compatibility with old config file)
sed -n 13p $HOME/Accuweather_conky_script/curr_cond_temp >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 12 точка росы Dew Point
sed -n 15p $HOME/Accuweather_conky_script/curr_cond_temp >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 13 видимость Visibility
sed -n 21p $HOME/Accuweather_conky_script/curr_cond_temp >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 14,15 солнце рассвет, закат Sun Rise Sun Set
sed -n 2,3p $HOME/Accuweather_conky_script/curr_cond_temp1 >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 16 солнце длит. Sunlight Duration
sed -n 1p $HOME/Accuweather_conky_script/curr_cond_temp1 >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 17 порывы ветра Wind Gusts
sed -n 11p $HOME/Accuweather_conky_script/curr_cond_temp >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 18,19 луна восход, заход Moon Rise Moon Set
sed -n 5,6p $HOME/Accuweather_conky_script/curr_cond_temp1 >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 20 Moonlight Duration
sed -n 4p $HOME/Accuweather_conky_script/curr_cond_temp1 >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 21 высота облаков Cloud Ceiling
sed -n 23p $HOME/Accuweather_conky_script/curr_cond_temp >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 22 #convert Image Number curr. cond. to Weather font letter curr. cond.
image=$(sed -n 1p $HOME/Accuweather_conky_script/curr_cond)
echo $(test_image $image) >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 23 Sun Rise-24h
sunrise_time=$(sed -n 14p $HOME/Accuweather_conky_script/curr_cond)
echo $(convert_time "$sunrise_time") >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 24 Sun Set-24h
sunrise_time=$(sed -n 15p $HOME/Accuweather_conky_script/curr_cond)
echo $(convert_time "$sunrise_time") >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 25 Moon Rise-24h
sunrise_time=$(sed -n 18p $HOME/Accuweather_conky_script/curr_cond)
echo $(convert_time "$sunrise_time") >> $HOME/Accuweather_conky_script/curr_cond
# curr_cond line 26 Moon Set-24h
sunrise_time=$(sed -n 19p $HOME/Accuweather_conky_script/curr_cond)
echo $(convert_time "$sunrise_time") >> $HOME/Accuweather_conky_script/curr_cond
## curr_cond line 27 convert Wind Direction curr. cond. to Wind font letter curr. cond.
wind=$(sed -n 5p $HOME/Accuweather_conky_script/curr_cond)
echo $(test_wind $wind) >> $HOME/Accuweather_conky_script/curr_cond
if (( $(sed -n 14p $HOME/Accuweather_conky_script/curr_cond|wc -c) == 8 )); then
sed -i '14s/^/0/' $HOME/Accuweather_conky_script/curr_cond
fi
if (( $(sed -n 15p $HOME/Accuweather_conky_script/curr_cond|wc -c) == 8 )); then
sed -i '15s/^/0/' $HOME/Accuweather_conky_script/curr_cond
fi
if (( $(sed -n 18p $HOME/Accuweather_conky_script/curr_cond|wc -c) == 8 )); then
sed -i '18s/^/0/' $HOME/Accuweather_conky_script/curr_cond
fi
if (( $(sed -n 19p $HOME/Accuweather_conky_script/curr_cond|wc -c) == 8 )); then
sed -i '19s/^/0/' $HOME/Accuweather_conky_script/curr_cond
fi
sleep 0.2
# Copy image clouds
if [[ $forecast2015 == 1 ]]; then
cp $HOME/Accuweather_conky_script/Forecast_Images_2015/$(sed -n 1p $HOME/Accuweather_conky_script/curr_cond).png $HOME/Accuweather_conky_script/forecast_2015/forecast_0.png
cp $HOME/Accuweather_conky_script/Forecast_Images_2015/$(sed -n 5p $HOME/Accuweather_conky_script/curr_cond).png $HOME/Accuweather_conky_script/forecast_2015/wind_0.png
fi
if [[ $forecast2016 == 1 ]]; then
cp $HOME/Accuweather_conky_script/Forecast_Images_2016/$(sed -n 1p $HOME/Accuweather_conky_script/curr_cond).png $HOME/Accuweather_conky_script/forecast_2016/forecast_0.png
cp $HOME/Accuweather_conky_script/Forecast_Images_2016/$(sed -n 5p $HOME/Accuweather_conky_script/curr_cond).png $HOME/Accuweather_conky_script/forecast_2016/wind_0.png
fi
fi
## delete tendency pressure
# sed -i '8s/^.*; //' $HOME/Accuweather_conky_script/curr_cond
## tendency pressure
#
sed -i -e '8s/↔/↔/g' -e '8s/↑/↑/g' -e '8s/↓/↓/g' -e '8s/↗/↗/g' -e '8s/↘/↘/g' -e '8s/↝/↝/g' $HOME/Accuweather_conky_script/curr_cond
########## location, time update
sed '/header-loc-weather">\|<p class="sub">/!d' $HOME/Accuweather_conky_script/curr_cond_raw > $HOME/Accuweather_conky_script/location
sed -i -e 's/^.*">//g' -e 's/<\/div>.*$//g' -e 's/<\/p>.*$//g' -e 's/,/ /' $HOME/Accuweather_conky_script/location
############
#Daily forecast
if [[ -s $HOME/Accuweather_conky_script/daily_forecast_raw ]]; then
sed '/<div class="daily-wrapper" data-qa="dailyCard0">/,/Further Ahead/!d' $HOME/Accuweather_conky_script/daily_forecast_raw > $HOME/Accuweather_conky_script/daily_forecast
# удаляем блок WinterCast
sed -i '/<div class="daily-wintercast-cta">/,/div class="daily-wrapper"/d' $HOME/Accuweather_conky_script/daily_forecast
# удалить строки между collapseConnatix и connatix" class (delete alert)
sed -i '/collapseConnatix/,/connatix" class/d' $HOME/Accuweather_conky_script/daily_forecast
sed -i '/script>/d' $HOME/Accuweather_conky_script/daily_forecast
# удалить строки между alert-banners и alert-description (delete alert)
sed -i '/alert-banners/,/alert-description/d' $HOME/Accuweather_conky_script/daily_forecast
sed -i -e 's/\.svg.*$//g' -e 's/°<\/span>//g' -e 's/<\/span>//g' $HOME/Accuweather_conky_script/daily_forecast
# сохранить состояние погоды в файле daily_phrase
sed '/class="phrase/!d' $HOME/Accuweather_conky_script/daily_forecast > $HOME/Accuweather_conky_script/daily_phrase
sed -i -e 's/<\/div>//g' -e 's/.*>//g' $HOME/Accuweather_conky_script/daily_phrase
sed -i -e 's/^.*">\///' -e 's/^.*">//' -e 's/.*weathericons\///g' -e 's/^[\t]*//g' -e '/^$/d' $HOME/Accuweather_conky_script/daily_forecast
sed -i -e '/<\|>\|fill=\|^[ ]*$\|Further Ahead/d' $HOME/Accuweather_conky_script/daily_forecast
#### вставка строк из файла phrase в файл daily_phrase ####
j=6
for (( i=1; i<=20; i+=1 ))
do
phrase=$(sed -n ${i}p $HOME/Accuweather_conky_script/daily_phrase)
sed -i "${j}s/^/$phrase\n/" $HOME/Accuweather_conky_script/daily_forecast
((j+=7))
done
sed -i '85,$d' $HOME/Accuweather_conky_script/daily_forecast
#
# Change a short name to a long one or translate into another language
# sed -i -e 's/^Sun$/Sunday/g' -e 's/^Mon$/Monday/g' -e 's/^Tue$/Tuesday/g' -e 's/^Wed$/Wednesday/g' -e 's/^Thu$/Thursday/g' -e 's/^Fri$/Friday/g' -e 's/^Sat$/Saturday/g' $HOME/Accuweather_conky_script/daily_forecast
sleep 0.2
# Copy image clouds
for (( i=1; i<=21; i+=1 ))
do
echo >> $HOME/Accuweather_conky_script/daily_forecast
done
for (( i=3; i<=80; i+=7 ))
do
image=$(sed -n "${i}"p $HOME/Accuweather_conky_script/daily_forecast)
echo $(test_image $image) >> $HOME/Accuweather_conky_script/daily_forecast
done
if [[ $forecast0 == 0 ]]; then
j=1
for (( i=3; i<=80; i+=7 ))
do
if [[ $forecast2015 == 1 ]]; then
cp $HOME/Accuweather_conky_script/Forecast_Images_2015/$(sed -n ${i}p $HOME/Accuweather_conky_script/daily_forecast).png $HOME/Accuweather_conky_script/forecast_2015/forecast_$j.png
fi
if [[ $forecast2016 == 1 ]]; then
cp $HOME/Accuweather_conky_script/Forecast_Images_2016/$(sed -n ${i}p $HOME/Accuweather_conky_script/daily_forecast).png $HOME/Accuweather_conky_script/forecast_2016/forecast_$j.png
fi
((j++))
done
fi
fi
fi
sleep 0.2
#############################################################
# HOURLY FORECAST: -h, -h2015 or -h2016 passed as arguments #
#############################################################
#function: convert_time_h
convert_time_h ()
{
hours=$(echo $1|awk -F ":| " '{print $1}')
am_or_pm=$(echo $1|awk -F ":| " '{print $2}')
if [[ $am_or_pm == "" ]]; then
echo $1
return 0
elif [[ $am_or_pm == AM ]]; then
if (( $hours < 10 )); then
hours_24=0$hours
fi
if (( $hours == 10 || $hours == 11 )); then
hours_24=$hours
fi
if (( $hours == 12 )); then
hours_24=00
fi
elif [[ $am_or_pm == PM ]]; then
if (( $hours != 12 )); then
hours_24=$((hours+12))
fi
if (( $hours == 12 )); then
hours_24=12
fi
fi
time_24=$hours_24:00
echo $time_24
}
if [[ $hourly0 == 1 || $hourly2015 == 1 || $hourly2016 == 1 ]]; then
#Hourly: 24h
hourly_addr1="$(echo $address|sed 's/weather-forecast.*$//')"hourly-weather-forecast/"$last_number"
hourly_addr2="$(echo $address|sed 's/weather-forecast.*$//')"hourly-weather-forecast/"$last_number"?day=2
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o $HOME/Accuweather_conky_script/hourly_raw1 "$hourly_addr1"
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o $HOME/Accuweather_conky_script/hourly_raw2 "$hourly_addr2"
if [[ -s $HOME/Accuweather_conky_script/hourly_raw1 && -s $HOME/Accuweather_conky_script/hourly_raw2 ]]; then
cat $HOME/Accuweather_conky_script/hourly_raw1 $HOME/Accuweather_conky_script/hourly_raw2 > $HOME/Accuweather_conky_script/hourly_raw_temp
sed '/<div class=\"hourly-wrapper content-module\">/,/day=/!d' $HOME/Accuweather_conky_script/hourly_raw_temp > $HOME/Accuweather_conky_script/hourly
# #Hourly file
#
sed -i '/div class=\"label-tooltip\" data-js=/,/div class=\"hourly-content-container/d' $HOME/Accuweather_conky_script/hourly
#remove spaces and tabs in lines
# sed -i -e 's/^[ \|\t]*//g' $HOME/Accuweather_conky_script/hourly
sed -i '/div class=\"real-feel-mobile/,/<\/div>/d' $HOME/Accuweather_conky_script/hourly
#Поменять ® на <span class="value">space
sed -i -e 's/®/<span class="value">space/g' $HOME/Accuweather_conky_script/hourly
# и к space присоединить следующую строку(удалив space и \n- новая строка)
sed -i -z 's/space\n//g' $HOME/Accuweather_conky_script/hourly
sed -i '/Indoor Humidity\|Air Quality\|RealFeel Shade\|RealFeel Guide\|Ice/d' $HOME/Accuweather_conky_script/hourly
#
sed -i '/class="date"\|weathericons\/\|temp metric\|RealFeel<span\|"phrase"\|Max UV Index\|Wind\|Wind Gusts\|Humidity\|Dew Point\|Cloud Cover\|Visibility\|Cloud Ceiling/!d' $HOME/Accuweather_conky_script/hourly
##adding empty lines for compatibility with the old config. file
#date
sed -i -e 's/<\/span><\/h2>/\n--/g' $HOME/Accuweather_conky_script/hourly
sed -i -e 's/<\/span>.*$//g' -e 's/\.svg.*$//g' -e 's/<\/div>.*$//g' -e 's/<span class="value">/\n/g' $HOME/Accuweather_conky_script/hourly
sed -i -e 's/.*weathericons\///g' -e 's/^.*>//g' -e 's/°.*$//g' -e 's/®//g' -e 's/^[ \|\t]*//g' $HOME/Accuweather_conky_script/hourly
#Populate Max UV and Prec. Amount values where needed
i=1
while IFS= read -r line;
do
if [[ $(sed -n ${i}p $HOME/Accuweather_conky_script/hourly) == Wind ]]; then
j=$((i-2))
if [[ $(sed -n ${j}p $HOME/Accuweather_conky_script/hourly) != 'Max UV Index' ]]; then
sed -i "${i}s/^/Max UV Index\n0\n/" $HOME/Accuweather_conky_script/hourly
((i+=3))
fi
elif [[ $(sed -n ${i}p $HOME/Accuweather_conky_script/hourly) == Visibility ]]; then
j=$((i-2))
if [[ $(sed -n ${j}p $HOME/Accuweather_conky_script/hourly) != 'Rain' && $(sed -n ${j}p $HOME/Accuweather_conky_script/hourly) != 'Snow' ]]; then
sed -i "${i}s/^/Prec. Amount\n-\n/" $HOME/Accuweather_conky_script/hourly
((i+=3))
fi
fi
((i+=1))
done < $HOME/Accuweather_conky_script/hourly
sed -i '/^$/d' $HOME/Accuweather_conky_script/hourly
##adding empty lines for compatibility with the old config. file
sed -i '/Dew Point/i Indoor Hum.\n0' $HOME/Accuweather_conky_script/hourly
sed -i '/Max UV Index/i precip\n-\nNot' $HOME/Accuweather_conky_script/hourly
sed -i '/^Further Ahead$/d' $HOME/Accuweather_conky_script/hourly
sed -i '721,$d' $HOME/Accuweather_conky_script/hourly
sed -i -e 's/ mph$\| km\/h$//g' -e 's/°.*$//g' $HOME/Accuweather_conky_script/hourly
##### del image hourly
if [[ $hourly2015 == 1 ]]; then
if [[ -f $HOME/Accuweather_conky_script/hourly_2015/hourly_*.png ]]; then
rm $HOME/Accuweather_conky_script/hourly_2015/hourly_*.png
fi
fi
if [[ $hourly2016 == 1 ]]; then
if [[ -f $HOME/Accuweather_conky_script/hourly_2016/hourly_*.png ]]; then
rm $HOME/Accuweather_conky_script/hourly_2016/hourly_*.png
fi
fi
# # Convert number image hourly to Weather font letter. Copy image clouds
for (( i=3; i<=720; i+=30 ))
do
image=$(sed -n "${i}"p $HOME/Accuweather_conky_script/hourly)
echo $(test_image $image) >> $HOME/Accuweather_conky_script/hourly
sed -i "$(( i+9 ))s/ .*$//" $HOME/Accuweather_conky_script/hourly
sed -i "$(( i+17 ))s/ .*$//" $HOME/Accuweather_conky_script/hourly
done
if [[ $hourly0 == 0 ]]; then
j=1
for (( i=3; i<=720; i+=30 ))
do
if [[ $hourly2015 == 1 ]]; then
cp $HOME/Accuweather_conky_script/Forecast_Images_2015/$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly).png $HOME/Accuweather_conky_script/hourly_2015/hourly_$j.png
fi
if [[ $hourly2016 == 1 ]]; then
cp $HOME/Accuweather_conky_script/Forecast_Images_2016/$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly).png $HOME/Accuweather_conky_script/hourly_2016/hourly_$j.png
fi
((j++))
done
fi
fi
# Convert times in hourly from am/pm to freedom times
for (( i=1; i<=720; i+=30 ))
do
h=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i ${i}s/^.*$/$(convert_time_h "$h")/ $HOME/Accuweather_conky_script/hourly
# # Add times in hourly :0 ru version
# sed -i ${i}s/^.*$/"$h":00/ $HOME/Accuweather_conky_script/hourly
done
sleep 0.2
##convert Wind Direction hourly to Wind font letter hourly
echo 'Font letter wind hourly ' >> $HOME/Accuweather_conky_script/hourly
j=1
for (( i=14; i<=720; i+=30 ))
do
wind=$(sed -n "${i}"p $HOME/Accuweather_conky_script/hourly | awk '{print $1}')
echo $(test_wind $wind) >> $HOME/Accuweather_conky_script/hourly
((j++))
done
##############################################################
# Full info, next 24h - altogether24 file
#
if [[ -f $HOME/Accuweather_conky_script/altogether24 ]]; then
#
rm $HOME/Accuweather_conky_script/altogether24
#
fi
#
if [[ -f $HOME/Accuweather_conky_script/altogether24_2015 ]]; then
#
rm $HOME/Accuweather_conky_script/altogether24_2015
#
fi
#
if [[ -f $HOME/Accuweather_conky_script/altogether24_2016 ]]; then
#
rm $HOME/Accuweather_conky_script/altogether24_2016
#
fi
#TIME
echo "\${color1}TIME\${goto 100}$(sed -n 1p $HOME/Accuweather_conky_script/hourly)" > $HOME/Accuweather_conky_script/altogether24
jump_to=160
for (( i=31; i<=360; i+=30 ))
do
time=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "1s/$/\${goto $jump_to}$time/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=361; i<=720; i+=30 ))
do
time=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "1s/$/\${goto $jump_to}$time/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
sed -i '1s/$/\n\n\n/' $HOME/Accuweather_conky_script/altogether24
#FORECAST
echo "\${color1}FORECAST\${color}" >> $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=7; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly|awk '{print $1}'|cut -c1-8)
sed -i "5s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=367; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly|awk '{print $1}'|cut -c1-8)
sed -i "5s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
sed -i '5s/$/\n/' $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=7; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly|awk '{print $2}'|cut -c1-8)
sed -i "6s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=367; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly|awk '{print $2}'|cut -c1-8)
sed -i "6s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
#TEMPERATURE
echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
echo "TEMPER.\${color}" >> $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=4; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "8s/$/\${goto $jump_to}$messg°/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=364; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "8s/$/\${goto $jump_to}$messg°/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
#REAL FEEL
echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
echo "REAL FEEL\${color}" >> $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=6; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "10s/$/\${goto $jump_to}$messg°/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=366; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "10s/$/\${goto $jump_to}$messg°/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
#CHANCE OF PRECIPITATION
echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
echo "PRECIP. %\${color}" >> $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=9; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "12s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=369; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "12s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
#MAX UV INDEX
echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
echo "UV INDEX\${color}" >> $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=12; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "14s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=372; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "14s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
#WIND
echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
echo "WIND\${color}" >> $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=14; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "16s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=374; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "16s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
#WIND GUSTS
echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
echo "WIND GUSTS\${color}" >> $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=16; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "18s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=376; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "18s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
#HUMIDITY
echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
echo "HUMIDITY\${color}" >> $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=18; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "20s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=378; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "20s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
#INDOOR HUMIDITY
echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
echo "IND. HUMID.\${color}" >> $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=20; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "22s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=380; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "22s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
#DEW POINT
echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
echo "DEW POINT\${color}" >> $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=22; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "24s/$/\${goto $jump_to}$messg°/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=382; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "24s/$/\${goto $jump_to}$messg°/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
#CLOUD COVER
echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
echo "CLOUD CVR\${color}" >> $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=24; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "26s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=384; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "26s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
#PRECIPITATION AMOUNT
echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
echo "PREC. AM.\${color}" >> $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=26; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "28s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=386; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "28s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
#VISIBILITY
echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
echo "VISIBILITY\${color}" >> $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=28; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "30s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=388; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "30s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
#CLOUD CEILING
echo "\${color1}\${goto 100}\${hr 1}" >> $HOME/Accuweather_conky_script/altogether24
echo "CLOUD CEIL.\${color}" >> $HOME/Accuweather_conky_script/altogether24
jump_to=100
for (( i=30; i<=360; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "32s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=390; i<=720; i+=30 ))
do
messg=$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)
sed -i "32s/$/\${goto $jump_to}$messg/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
#IMAGES
if [[ $hourly0 == 0 ]]; then
if [[ $hourly2015 == 1 ]]; then
jump_to=75
cp $HOME/Accuweather_conky_script/altogether24 $HOME/Accuweather_conky_script/altogether24_2015
fi
if [[ $hourly2016 == 1 ]]; then
jump_to=85
cp $HOME/Accuweather_conky_script/altogether24 $HOME/Accuweather_conky_script/altogether24_2016
fi
# if [[ -f $HOME/Accuweather_conky_script/altogether24 ]]; then
# rm $HOME/Accuweather_conky_script/altogether24
# fi
hours=$((12+$h_24hours*12))
for (( i=1; i<=$hours; i+=1 ))
do
if [[ $hourly2015 == 1 ]]; then
sed -i "4s/$/\${image \$HOME\/Accuweather_conky_script\/hourly_2015\/hourly_$i.png -s 60x36 -p $jump_to,49}/" $HOME/Accuweather_conky_script/altogether24_2015
fi
if [[ $hourly2016 == 1 ]]; then
sed -i "4s/$/\${image \$HOME\/Accuweather_conky_script\/hourly_2016\/hourly_$i.png -s 36x36 -p $jump_to,49}/" $HOME/Accuweather_conky_script/altogether24_2016
fi
((jump_to+=60))
done
fi
#CONKYFONT
if [[ $hourly0 == 1 ]]; then
sed -i '4s/$/\${color}\${font conkyweather:size=35}/' $HOME/Accuweather_conky_script/altogether24
jump_to=95
for (( i=721; i<=732; i+=1 ))
do
sed -i "4s/$/\${goto $jump_to}$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
if [[ $h_24hours == 1 ]]; then
for (( i=733; i<=744; i+=1 ))
do
sed -i "4s/$/\${goto $jump_to}$(sed -n ${i}p $HOME/Accuweather_conky_script/hourly)/" $HOME/Accuweather_conky_script/altogether24
((jump_to+=60))
done
fi
sed -i '4s/$/\${font}/' $HOME/Accuweather_conky_script/altogether24
sed -i '2,3d' $HOME/Accuweather_conky_script/altogether24
fi
#DELETE UNWANTED VARIABLES
if [[ $h_real == 0 ]]; then
if [[ $hourly0 == 1 ]]; then
sed -i '7,8s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
elif [[ $hourly2015 == 1 ]]; then
sed -i '9,10s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
elif [[ $hourly2016 == 1 ]]; then
sed -i '9,10s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
fi
fi
if [[ $h_uv == 0 ]]; then
if [[ $hourly0 == 1 ]]; then
sed -i '11,12s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
elif [[ $hourly2015 == 1 ]]; then
sed -i '13,14s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
elif [[ $hourly2016 == 1 ]]; then
sed -i '13,14s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
fi
fi
if [[ $h_wind == 0 ]]; then
if [[ $hourly0 == 1 ]]; then
sed -i '13,14s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
elif [[ $hourly2015 == 1 ]]; then
sed -i '15,16s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
elif [[ $hourly2016 == 1 ]]; then
sed -i '15,16s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
fi
fi
if [[ $h_wind_g == 0 ]]; then
if [[ $hourly0 == 1 ]]; then
sed -i '15,16s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
elif [[ $hourly2015 == 1 ]]; then
sed -i '17,18s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
elif [[ $hourly2016 == 1 ]]; then
sed -i '17,18s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
fi
fi
if [[ $h_hum == 0 ]]; then
if [[ $hourly0 == 1 ]]; then
sed -i '17,18s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
elif [[ $hourly2015 == 1 ]]; then
sed -i '19,20s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
elif [[ $hourly2016 == 1 ]]; then
sed -i '19,20s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
fi
fi
if [[ $h_ind_hum == 0 ]]; then
if [[ $hourly0 == 1 ]]; then
sed -i '19,20s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
elif [[ $hourly2015 == 1 ]]; then
sed -i '21,22s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
elif [[ $hourly2016 == 1 ]]; then
sed -i '21,22s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
fi
fi
if [[ $h_dew == 0 ]]; then
if [[ $hourly0 == 1 ]]; then
sed -i '21,22s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
elif [[ $hourly2015 == 1 ]]; then
sed -i '23,24s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
elif [[ $hourly2016 == 1 ]]; then
sed -i '23,24s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
fi
fi
if [[ $h_cl_cov == 0 ]]; then
if [[ $hourly0 == 1 ]]; then
sed -i '23,24s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
elif [[ $hourly2015 == 1 ]]; then
sed -i '25,26s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
elif [[ $hourly2016 == 1 ]]; then
sed -i '25,26s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
fi
fi
if [[ $h_prec_am == 0 ]]; then
if [[ $hourly0 == 1 ]]; then
sed -i '25,26s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
elif [[ $hourly2015 == 1 ]]; then
sed -i '27,28s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
elif [[ $hourly2016 == 1 ]]; then
sed -i '27,28s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
fi
fi
if [[ $h_visib == 0 ]]; then
if [[ $hourly0 == 1 ]]; then
sed -i '27,28s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
elif [[ $hourly2015 == 1 ]]; then
sed -i '29,30s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
elif [[ $hourly2016 == 1 ]]; then
sed -i '29,30s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
fi
fi
if [[ $h_cl_ceil == 0 ]]; then
if [[ $hourly0 == 1 ]]; then
sed -i '29,30s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24
elif [[ $hourly2015 == 1 ]]; then
sed -i '31,32s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2015
elif [[ $hourly2016 == 1 ]]; then
sed -i '31,32s/^.*$/VOID/' $HOME/Accuweather_conky_script/altogether24_2016
fi
fi
if [[ -f $HOME/Accuweather_conky_script/altogether24 ]]; then
sed -i '/VOID/d' $HOME/Accuweather_conky_script/altogether24
fi
if [[ -f $HOME/Accuweather_conky_script/altogether24_2015 ]]; then
sed -i '/VOID/d' $HOME/Accuweather_conky_script/altogether24_2015
fi
if [[ -f $HOME/Accuweather_conky_script/altogether24_2016 ]]; then
sed -i '/VOID/d' $HOME/Accuweather_conky_script/altogether24_2016
fi
fi
sleep 0.5
##################################################################
#del. temp files
#
if [[ -f $HOME/Accuweather_conky_script/curr_cond_temp ]]; then
#
rm $HOME/Accuweather_conky_script/curr_cond_temp
#
fi
#
if [[ -f $HOME/Accuweather_conky_script/curr_cond_temp1 ]]; then
#
rm $HOME/Accuweather_conky_script/curr_cond_temp1
#
fi
# if [[ -f $HOME/Accuweather_conky_script/curr_cond_control_point ]]; then
# rm $HOME/Accuweather_conky_script/curr_cond_control_point
# fi
#
if [[ -f $HOME/Accuweather_conky_script/hourly_raw_temp ]]; then
#
rm $HOME/Accuweather_conky_script/hourly_raw_temp
#
fi
###############################################################
#del. raw files
# if [[ -f $HOME/Accuweather_conky_script/curr_cond_raw ]]; then
# rm $HOME/Accuweather_conky_script/curr_cond_raw
# fi
# if [[ -f $HOME/Accuweather_conky_script/daily_forecast_raw ]]; then
# rm $HOME/Accuweather_conky_script/daily_forecast_raw
# fi
# if [[ -f $HOME/Accuweather_conky_script/hourly_raw1 ]]; then
# rm $HOME/Accuweather_conky_script/hourly_raw1
# fi
# if [[ -f $HOME/Accuweather_conky_script/hourly_raw2 ]]; then
# rm $HOME/Accuweather_conky_script/hourly_raw2
# fi
#
##################################################################
#Resume weather conky
pkill -CONT -xf "$weather_conky_launch_command"And I'm wondering if you'd like to fix it, or if some kind soul can help me out. As I've written several times, I understand nothing about scripts.
Thanks to anyone who can help me.
Best Regards
ok, it seems to have been solved, if I find anything else I'll write, thanks
Last edited by ector1935 (2026-04-04 13:46:03)
Offline
^ I'm glad you made it.
Please see the post below.
If people would know how little brain is ruling the world, they would die of fear.
Offline
@all
I forgot to say this:
Please increase the script update period.
Set it to 45m (2700s).
The weather forecast is not a basketball game and the score rarely changes.
That is enough to always have fresh data.
Thanks in advance!
If people would know how little brain is ruling the world, they would die of fear.
Offline
Hello
marens
I think I've followed all your new instructions, but it's not working for me. This is what I'm seeing in the console:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 45868 0 45868 0 0 136k 0 --:--:-- --:--:-- --:--:-- 136k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 45753 0 45753 0 0 125k 0 --:--:-- --:--:-- --:--:-- 125k
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 2: syntax error
(standard_in) 1: syntax error
cp: impossible d'évaluer '/mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2015/06.png': Aucun fichier ou dossier de ce nom
cp: impossible d'évaluer '/mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2015/06.png': Aucun fichier ou dossier de ce nom
cp: impossible d'évaluer '/mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2015/02.png': Aucun fichier ou dossier de ce nom
cp: impossible d'évaluer '/mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2015/01.png': Aucun fichier ou dossier de ce nom
cp: impossible d'évaluer '/mnt/9d01359b-9705-43f9-be12-4d6d7mon script
#!/usr/bin/env bash
####### modifié par marens du forum Bounsenlabs pour les heures en juillet 2024 ############
#########################################################################################
# Put the command that launches the conky configuration file that uses this script here #
#########################################################################################
weather_conky_launch_command="conky -b"
#### mise à jour unklar ####
date +%T > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/actualisation
address="https://www.accuweather.com/en/fr/sarreguemines/135050/weather-forecast/135050"
#Pause weather conky
pkill -STOP -xf "$weather_conky_launch_command"
#function: test_image
test_image () {
case $1 in
1)
echo a
;;
2|3)
echo b
;;
4|5)
echo c
;;
6)
echo d
;;
7)
echo e
;;
8)
echo f
;;
11)
echo 0
;;
12)
echo h
;;
13|14)
echo g
;;
15)
echo m
;;
16|17)
echo k
;;
18)
echo i
;;
19)
echo q
;;
20|21|23)
echo o
;;
22)
echo r
;;
24|31)
echo E
;;
25)
echo v
;;
26)
echo x
;;
29)
echo y
;;
30)
echo 5
;;
32)
echo 6
;;
33)
echo A
;;
34|35)
echo B
;;
36|37)
echo C
;;
38)
echo D
;;
39|40)
echo G
;;
41|42)
echo K
;;
43|44)
echo O
;;
*)
echo -
;;
esac
}
#function: test_wind
test_wind () {
case $1 in
CLM)
echo \-
;;
S)
echo 1
;;
SSW)
echo 2
;;
SW)
echo 3
;;
WSW)
echo 4
;;
W)
echo 5
;;
WNW)
echo 6
;;
NW)
echo 7
;;
NNW)
echo 8
;;
N)
echo 9
;;
NNE)
echo \:
;;
NE)
echo \;
;;
ENE)
echo \<
;;
E)
echo \=
;;
ESE)
echo \>
;;
SE)
echo \?
;;
SSE)
echo \@
;;
esac
}
############################
# Check the user arguments #
############################
if (( $# < 1 || $# > 18 )); then
echo "Invalid arguments!"
exit
fi
forecast0=0
forecast2015=0
forecast2016=0
hourly0=0
hourly2015=0
hourly2016=0
h_24hours=1
h_real=1
h_uv=1
h_wind=1
h_wind_g=1
h_hum=1
h_ind_hum=1
h_dew=1
h_cl_cov=1
h_prec_am=1
h_visib=1
h_cl_ceil=1
for i in $*
do
if [[ $i != -f && $i != -f2015 && $i != -f2016 && $i != -h && $i != -h2015 && $i != -h2016 && $i != -h_12h && $i != -h_no_real && $i != -h_no_uv && $i != -h_no_wind && $i != -h_no_wind_g && $i != -h_no_hum && $i != -h_no_ind_hum && $i != -h_no_dew && $i != -h_no_cl_cov && $i != -h_no_prec_am && $i != -h_no_visib && $i != -h_no_cl_ceil ]]; then
echo "Invalid arguments!"
exit
fi
case $i in
-f)
forecast0=1
;;
-f2015)
forecast2015=1
;;
-f2016)
forecast2016=1
;;
-h)
hourly0=1
;;
-h2015)
hourly2015=1
;;
-h2016)
hourly2016=1
;;
-h_12h)
h_24hours=0
;;
-h_no_real)
h_real=0
;;
-h_no_uv)
h_uv=0
;;
-h_no_wind)
h_wind=0
;;
-h_no_wind_g)
h_wind_g=0
;;
-h_no_hum)
h_hum=0
;;
-h_no_ind_hum)
h_ind_hum=0
;;
-h_no_dew)
h_dew=0
;;
-h_no_cl_cov)
h_cl_cov=0
;;
-h_no_prec_am)
h_prec_am=0
;;
-h_no_visib)
h_visib=0
;;
-h_no_cl_ceil)
h_cl_ceil=0
;;
esac
done
if [[ $forecast0 == 1 ]]; then
forecast2015=0
forecast2016=0
fi
if [[ $hourly0 == 1 ]]; then
hourly2015=0
hourly2016=0
fi
last_number=$(echo $address|sed 's/^.*\///')
#############################################################
# NORMAL FORECAST: -f, -f2015 or -f2016 passed as arguments #
#############################################################
if [[ $forecast0 == 1 || $forecast2015 == 1 || $forecast2016 == 1 ]]; then
#function: convert_time
convert_time ()
{
hours=$(echo $1|awk -F ":| " '{print $1}')
minutes=$(echo $1|awk -F ":| " '{print $2}')
am_or_pm=$(echo $1|awk -F ":| " '{print $3}')
if [[ $am_or_pm == "" ]]; then
echo $1
return 0
elif [[ $am_or_pm == AM ]]; then
if (( $hours < 10 )); then
hours_24=0$hours
fi
if (( $hours == 10 || $hours == 11 )); then
hours_24=$hours
fi
if (( $hours == 12 )); then
hours_24=00
fi
elif [[ $am_or_pm == PM ]]; then
if (( $hours != 12 )); then
hours_24=$((hours+12))
fi
if (( $hours == 12 )); then
hours_24=12
fi
fi
time_24=$hours_24:$minutes
if [[ $1 != "--" ]]; then
echo $time_24
elif [[ $1 == "--" ]]; then
echo "--"
fi
}
sleep 0.2
curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"
#curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_raw "$curr_addr"
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:147.0) Gecko/20100101 Firefox/147.0' -H 'access-control-allow-origin: *' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.9' --compressed -H 'Connection: keep-alive' -H 'Sec-GPC: 1' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_raw "$curr_addr"
daily_addr="$(echo $address|sed 's/weather-forecast.*$//')"10-day-weather-forecast/"$last_number"
#daily_addr="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
#curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast_raw "$daily_addr"
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:147.0) Gecko/20100101 Firefox/147.0' -H 'access-control-allow-origin: *' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.9' --compressed -H 'Connection: keep-alive' -H 'Sec-GPC: 1' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast_raw "$daily_addr"
##### del image forecast
if [[ $forecast2015 == 1 ]]; then
if [[ -f /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2015/forecast_*.png ]]; then
rm /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2015/forecast_*.png
fi
fi
if [[ $forecast2016 == 1 ]]; then
if [[ -f /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2016/forecast_*.png ]]; then
rm /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2016/forecast_*.png
fi
fi
sleep 0.2
#current conditions
if [[ -s /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_raw ]]; then
sed '/current-weather-card/,/glacier-ad /!d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_raw > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp
sed -i '/div class=\"label-tooltip\" data-js/,/div class=\"current-weather-details/d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp
## Marens Settings - Added Line
sed -i -e 's/\.svg.*$//g' -e 's/<\/div>//g' -e 's/<div>//g' -e 's/<\/span>//g' -e 's/<span class.*$//g' -e 's/^[\t]*//g' -e 's/v2a\///g' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp
sed -i -e 's/.*weathericons\///' -e 's/^.*>//g' -e 's/°.*$//g' -e '/RealFeel®/d' -e '/RealFeel Shade™/,+1d' -e '/RealFeel Shade/,+1d' -e '/Indoor Humidity/,+1d' -e '/^$/d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp
#
sed -i '1s/^0//' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp
# temporary file to control
#
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_control_point
if [[ $(sed -n 5p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp) != 'Max UV Index' ]]; then
sed -i "5s/^/Max UV\n-\n/" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp
fi
wind_dir=$(sed -n 8p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp|head -c 1)
if [[ $wind_dir == 0 ]]; then
sed -i '8s/^/CLM /' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp
fi
sed -i '8s/ /\n/1' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp
sed '/sunrise-sunset content-module /,/temp-history content-module/!d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_raw > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp1
sed -i -e '/div/g' -e '/img/g' -e '/times-label/g' -e '/title\|Sun \|h2/g' -e 's/^[\t]*//g' -e '/^$/d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp1
sed -i 's/<span class="sunrise-sunset__times-value">//g' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp1
sed -i 's/<span class="sunrise-sunset__phrase">//g' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp1
sed -i 's/<\/span>//g' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp1
sed -i 's/ hrs /:/g' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp1
sed -i 's/ mins//g' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp1
# curr_cond line 1,2 номер изобр. облака и температуры сейчас , number icon and Temperature now
sed -n 1,2p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 3 температура ощущение Real Feel
sed -n 4p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 4 облачность Forecast
sed -n 3p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 5 направление ветра Wind Direction
sed -n 8p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 6 скорость ветра Wind Speed
#
sed -n 9p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 7 влажность Humidity
sed -n 13p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 8 давление Pressure
sed -n 17p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 9 УФ индекс UV Index
sed -n 6p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 10 облачность Cloud Cover
sed -n 19p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 11 влажность Indoor Humidity (for compatibility with old config file)
sed -n 13p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 12 точка росы Dew Point
sed -n 15p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 13 видимость Visibility
sed -n 21p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 14,15 солнце рассвет, закат Sun Rise Sun Set
sed -n 2,3p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp1 >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 16 солнце длит. Sunlight Duration
sed -n 1p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp1 >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 17 порывы ветра Wind Gusts
sed -n 11p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 18,19 луна восход, заход Moon Rise Moon Set
sed -n 5,6p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp1 >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 20 Moonlight Duration
sed -n 4p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp1 >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 21 высота облаков Cloud Ceiling
sed -n 23p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 22 #convert Image Number curr. cond. to Weather font letter curr. cond.
image=$(sed -n 1p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond)
echo $(test_image $image) >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 23 Sun Rise-24h
sunrise_time=$(sed -n 14p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond)
echo $(convert_time "$sunrise_time") >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 24 Sun Set-24h
sunrise_time=$(sed -n 15p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond)
echo $(convert_time "$sunrise_time") >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 25 Moon Rise-24h
sunrise_time=$(sed -n 18p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond)
echo $(convert_time "$sunrise_time") >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
# curr_cond line 26 Moon Set-24h
sunrise_time=$(sed -n 19p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond)
echo $(convert_time "$sunrise_time") >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
## curr_cond line 27 convert Wind Direction curr. cond. to Wind font letter curr. cond.
wind=$(sed -n 5p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond)
echo $(test_wind $wind) >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
if (( $(sed -n 14p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond|wc -c) == 8 )); then
sed -i '14s/^/0/' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
fi
if (( $(sed -n 15p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond|wc -c) == 8 )); then
sed -i '15s/^/0/' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
fi
if (( $(sed -n 18p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond|wc -c) == 8 )); then
sed -i '18s/^/0/' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
fi
if (( $(sed -n 19p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond|wc -c) == 8 )); then
sed -i '19s/^/0/' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
fi
sed -i 's/--/N\/A/g' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
## moonrise
moonrise_hour=$(sed -n '25p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond | awk -F':' '{print $1}')
moonrise_min=$(sed -n '25p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond | awk -F':' '{print $2}')
## moonset
moonset_hour=$(sed -n '26p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond | awk -F':' '{print $1}')
moonset_min=$(sed -n '26p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond | awk -F':' '{print $2}')
## convert to minutes
convert_moonrise=$(echo $moonrise_hour*60+$moonrise_min | bc)
convert_moonset=$(echo $moonset_hour*60+$moonset_min | bc)
## time2 - time1
diff=$(echo $convert_moonset-$convert_moonrise | bc)
if [[ $diff -ge 0 ]]; then
diff1=$(echo $diff)
else
diff1=$(echo 1440-${diff#-} | bc)
fi
## back to hours
hours=$(echo $diff1 / 60 | bc)
hours1=$(echo $diff1 / 60 | bc -l)
## back to minutes
diff_min=$(echo $hours1-$hours | bc -l)
minutes1=$(echo $diff_min*60 | bc)
minutes=$(echo $minutes1 | awk '{print int($1)}')
#### Print MoonDuration
moonrise=$(sed -n '25p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond)
moonset=$(sed -n '26p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond)
if [[ "$moonrise" == "N/A" || "$moonset" == "N/A" ]]; then
printf "N/A" > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/moon_duration
else
if [[ $hours -ge 10 && $minutes -ge 10 ]]; then
printf "$hours:$minutes" > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/moon_duration
fi
if [[ $hours -lt 10 && $minutes -lt 10 ]]; then
printf "$hours:0$minutes" > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/moon_duration
fi
if [[ $hours -ge 10 && $minutes -lt 10 ]]; then
printf "$hours:0$minutes" > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/moon_duration
fi
if [[ $hours -lt 10 && $minutes -ge 10 ]]; then
printf "$hours:$minutes" > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/moon_duration
fi
fi
# Moon Duration instead of Moon Phase in curr_cond file
replacement=$(sed -n 1p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/moon_duration)
sed -i '20d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
sed -i "20s%^%$replacement\n%" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
sleep 0.2
# Copy image clouds
if [[ $forecast2015 == 1 ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2015/$(sed -n 1p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond).png /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2015/forecast_0.png
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2015/$(sed -n 5p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond).png /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2015/wind_0.png
fi
if [[ $forecast2016 == 1 ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2016/$(sed -n 1p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond).png /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2016/forecast_0.png
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2016/$(sed -n 5p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond).png /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2016/wind_0.png
fi
fi
## tendency pressure
#
sed -i -e '8s/↔/↔/g' -e '8s/↑/↑/g' -e '8s/↓/↓/g' -e '8s/↗/↗/g' -e '8s/↘/↘/g' -e '8s/↝/↝/g' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
########## location, time update
sed '/header-loc-weather">\|<p class="sub">/!d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_raw > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/location
sed -i -e 's/^.*">//g' -e 's/<\/div>.*$//g' -e 's/<\/p>.*$//g' -e 's/,/ /' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/location
#icone direction vent
wind_direction=$(sed -n 5p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond)
if [[ $wind_direction == "S" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"02.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "South" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"02.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "SSW" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"03.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "SSO" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"03.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "SW" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"04.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "SO" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"04.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "WSW" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"05.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "OSO" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"05.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "W" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"06.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "O" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"06.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "West" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"06.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "WNW" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"07.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "ONO" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"07.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "NO" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"08.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "NW" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"08.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "NNW" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"09.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "NNO" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"09.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "N" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"10.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "North" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"10.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "NNE" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"11.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "NE" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"12.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "ENE" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"13.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "E" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"14.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "East" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"14.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "ESE" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"15.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "SE" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"16.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "SSE" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"17.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
elif [[ $wind_direction == "Variable" ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/vents/"00.png" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Wind1.png
fi
############
############################################################
# DAILY FORECAST: -h, -h2015 or -h2016 passed as arguments #
#############################################################
if [[ -s /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast_raw ]]; then
sed '/<div class="daily-wrapper" data-qa="dailyCard0">/,/Further Ahead/!d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast_raw > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast
# сохранить состояние погоды в файле daily_phrase
sed '/class="phrase/!d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_phrase
sed -i -e 's/<\/div>//g' -e 's/.*>//g' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_phrase
# удаляем блок WinterCast
sed -i '/<div class="daily-wintercast-cta">/,/div class="daily-wrapper"/d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast
# удалить строки между collapseConnatix и connatix" class (delete alert)
sed -i '/collapseConnatix/,/connatix" class/d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast
sed -i '/script>/d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast
# удалить строки между alert-banners и alert-description (delete alert)
sed -i '/alert-banners/,/alert-description/d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast
## Marens Settings - Added Line
sed -i -e 's/\.svg.*$//g' -e 's/°<\/span>//g' -e 's/<\/span>//g' -e 's/v2a\///g' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast
sed -i -e 's/^.*">\///' -e 's/^.*">//' -e 's/.*weathericons\///g' -e 's/^[\t]*//g' -e '/^$/d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast
sed -i -e '/<\|>\|fill=\|^[ ]*$\|Further Ahead/d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast
#### вставка строк из файла phrase в файл daily_phrase ####
j=6
for (( i=1; i<=20; i+=1 ))
do
phrase=$(sed -n ${i}p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_phrase)
sed -i "${j}s/^/$phrase\n/" /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast
((j+=7))
done
sed -i '85,$d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast
#
# Change a short name to a long one or translate into another language
sed -i -e 's/^Sun$/Sunday/g' -e 's/^Mon$/Monday/g' -e 's/^Tue$/Tuesday/g' -e 's/^Wed$/Wednesday/g' -e 's/^Thu$/Thursday/g' -e 's/^Fri$/Friday/g' -e 's/^Sat$/Saturday/g' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast
sleep 0.2
# Copy image clouds
for (( i=1; i<=21; i+=1 ))
do
echo >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast
done
for (( i=3; i<=80; i+=7 ))
do
image=$(sed -n "${i}"p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast)
echo $(test_image $image) >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast
done
if [[ $forecast0 == 0 ]]; then
j=1
for (( i=3; i<=80; i+=7 ))
do
if [[ $forecast2015 == 1 ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2015/$(sed -n ${i}p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast).png /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2015/forecast_$j.png
fi
if [[ $forecast2016 == 1 ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2016/$(sed -n ${i}p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast).png /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2016/forecast_$j.png
fi
((j++))
done
fi
fi
fi
sleep 0.2
############################################################
# HOURLY FORECAST: -h, -h2015 or -h2016 passed as arguments #
#############################################################
#function: convert_time_h
convert_time_h ()
{
hours=$(echo $1|awk -F ":| " '{print $1}')
am_or_pm=$(echo $1|awk -F ":| " '{print $2}')
if [[ $am_or_pm == "" ]]; then
echo $1
return 0
elif [[ $am_or_pm == AM ]]; then
if (( $hours < 10 )); then
hours_24=0$hours
fi
if (( $hours == 10 || $hours == 11 )); then
hours_24=$hours
fi
if (( $hours == 12 )); then
hours_24=00
fi
elif [[ $am_or_pm == PM ]]; then
if (( $hours != 12 )); then
hours_24=$((hours+12))
fi
if (( $hours == 12 )); then
hours_24=12
fi
fi
time_24=$hours_24:00
echo $time_24
}
if [[ $hourly0 == 1 || $hourly2015 == 1 || $hourly2016 == 1 ]]; then
#Hourly: 24h
hourly_addr1="$(echo $address|sed 's/weather-forecast.*$//')"hourly-weather-forecast/"$last_number"
hourly_addr2="$(echo $address|sed 's/weather-forecast.*$//')"hourly-weather-forecast/"$last_number"?day=2
#curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw1 "$hourly_addr1"
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:147.0) Gecko/20100101 Firefox/147.0' -H 'access-control-allow-origin: *' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.9' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw1 "$hourly_addr1"
#curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw2 "$hourly_addr2"
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:147.0) Gecko/20100101 Firefox/147.0' -H 'access-control-allow-origin: *' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.9' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0' -o /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw2 "$hourly_addr2"
if [[ -s /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw1 && -s /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw2 ]]; then
cat /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw1 /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw2 > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw_temp
##### modification pour vent de marrens du 17-01-2026 ########
# cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw_temp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/raws/raw
# cat /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/raws/raw | grep 'Wind<' | sed 's/^[ \t]*//' | sed 's/<p>Wind<span class="value">//g' | sed 's/<\/span><\/p>//g' > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/vent
#cat /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/raws/raw | grep 'class="phrase"' | awk -F'">' '{print $2}' | sed -r 's/.{6}$//' | trans -brief :fr > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/conditions
sed '/<div class=\"hourly-wrapper content-module\">/,/day=/!d' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw_temp > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly
#### Marens Hourly
#Time
cat /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly | grep -A 1 'class="date"' | grep 'div' | sed 's/^[ \t]*//' | sed -r 's/.{5}//' | sed -r 's/.{6}$//' > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/time
#Icons
cat /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly | grep '<svg class="icon" data-src="/images/weathericons/' | awk '{print $3}' | awk -F'weathericons/' '{print $2}' | sed -r 's/.{5}$//' | sed s'/v2a\///g' > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/icons
#cat /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly | grep '<svg class="icon" data-src="/images/weathericons/' | awk '{print $3}' | awk -F'weathericons/' '{print $2}' | sed -r 's/.{5}$//' > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/icons
#Temperature
cat /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly | grep '"temp metric"' | awk -F'">' '{print $2}' | sed -r 's/.{12}$//' > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/temperature
#RealFeel
cat /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly | grep -A 1 'RealFeel®' | grep '°' | sed 's/^[ \t]*//' | sed -r 's/.{6}$//' > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/realfeel
#Phrase
cat /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly | grep 'class="phrase"' | awk -F'">' '{print $2}' | sed -r 's/.{6}$//' | trans -brief :fr > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/phrase
#Wind
cat /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly | grep 'Wind<' | sed 's/^[ \t]*//' | sed 's/<p>Wind<span class="value">//g' | sed 's/<\/span><\/p>//g' > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/wind
cat /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly | grep 'Wind<' | sed 's/^[ \t]*//' | sed 's/<p>Wind<span class="value">//g' | sed 's/<\/span><\/p>//g' | awk '{print $1}' > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/dir
cat /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly | grep 'Wind<' | sed 's/^[ \t]*//' | sed 's/<p>Wind<span class="value">//g' | sed 's/<\/span><\/p>//g' | awk '{print $2}' > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/vit
#Wind images
sed -i 's/^0/CLM 0/g' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/wind
j=1
for (( i=1; i<=10; i+=1 ))
do
if [[ $hourly2015 == 1 ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2015/$(sed -n ${i}p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/wind | awk '{print $1}').png /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/hourly_images/wind_$j.png
fi
if [[ $hourly2016 == 1 ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2016/$(sed -n ${i}p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/wind| awk '{print $1}').png /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/hourly_images/wind_$j.png
fi
((j++))
done
#Convert time
for (( i=1; i<=48; i+=1 ))
do
h=$(sed -n ${i}p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/time)
sed -i ${i}s/^.*$/$(convert_time_h "$h")/ /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/time
done
sleep 0.2
#Hourly images
j=1
for (( i=1; i<=10; i+=1 ))
do
if [[ $forecast2015 == 1 ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2015/$(sed -n ${i}p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | sed 's/^0*//').png /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2015/forecast_$j.png
fi
if [[ $forecast2016 == 1 ]]; then
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2016/$(sed -n ${i}p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | sed 's/^0*//').png /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2016/forecast_$j.png fi
((j++))
fi
fi
#### del. temp files
if [[ -f /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp ]]; then
rm /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp
fi
if [[ -f /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp1 ]]; then
rm /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_temp1
fi
if [[ -f /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw_temp ]]; then
rm /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw_temp
fi
if [[ -f /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_raw ]]; then
rm /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond_raw
fi
if [[ -f /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast_raw ]]; then
rm /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast_raw
fi
if [[ -f /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw1 ]]; then
rm /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw1
fi
if [[ -f /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw2 ]]; then
rm /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly_raw2
fi
#if [[ -f /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly ]]; then
#rm /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly
#fi
##################################################################
sed -i -e 's/NW/NO/g' -e 's/WNW/ONO/g' -e 's/NNW/NNO/g' -e 's/W/O/g' -e 's/SSW/SSO/g' -e 's/SW/SO/g' -e 's/WSW/OSO/g' -e 's/W/O/g' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond
sed -i -e 's/NW/NO/g' -e 's/WNW/ONO/g' -e 's/NNW/NNO/g' -e 's/W/O/g' -e 's/SSW/SSO/g' -e 's/SW/SO/g' -e 's/WSW/OSO/g' -e 's/W/O/g' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/wind
#### Marens - French Translation
rm /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_fr
sed -n '4p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/curr_cond | trans -brief :fr > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_fr
sed -n ' 6p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | trans -brief :fr >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_fr
sed -n '13p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | trans -brief :fr >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_fr
sed -n '20p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | trans -brief :fr >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_fr
sed -n '27p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | trans -brief :fr >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_fr
sed -n '34p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | trans -brief :fr >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_fr
sed -n '41p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | trans -brief :fr >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_fr
sed -n '48p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | trans -brief :fr >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_fr
sed -n '55p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | trans -brief :fr >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_fr
sed -n '62p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | trans -brief :fr >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_fr
sed -n '69p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | trans -brief :fr >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_fr
sed -n '76p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | trans -brief :fr >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_fr
sed -n '83p' /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | trans -brief :fr >> /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_fr
#Resume weather conky
pkill -CONT -xf "$weather_conky_launch_command"many tanks &
@+
Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX
Offline
^ I don't know what command you ran in the terminal (conky).
Daily or hourly weather forecast?
Do you use the weather font?
If it is a weather font, then you need to change the beginning of
#function: test_image as shown above.
EDIT
Replace:
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2015/$(sed -n ${i}p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast).png /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2015/forecast_$j.pngwith:
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2015/$(sed -n ${i}p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | sed 's/^0*//').png /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2015/forecast_$j.pngLast edited by marens (Yesterday 18:01:27)
If people would know how little brain is ruling the world, they would die of fear.
Offline
hello
i use this
conky -c /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/configs/didierth& this in conkyrc
${execi 900 bash /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/accuweather -f2015 -h2015}daily & your marens hourly
no weatherfont just forecast images 2015
@+
Last edited by loutch (Yesterday 18:09:19)
Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX
Offline
^ I edited my post.
You didn't replace the line:
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2015/$(sed -n ${i}p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast).png /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2015/forecast_$j.pngwith:
cp /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/Forecast_Images_2015/$(sed -n ${i}p /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/daily_forecast | sed 's/^0*//').png /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/forecast_2015/forecast_$j.pngIf people would know how little brain is ruling the world, they would die of fear.
Offline
re
Oups , have this now
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 45470 0 45470 0 0 139k 0 --:--:-- --:--:-- --:--:-- 140k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 45813 0 45813 0 0 143k 0 --:--:-- --:--:-- --:--:-- 143k
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 2: syntax error
(standard_in) 1: syntax error
/mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/accuweather: ligne 888: erreur de syntaxe : fin de fichier prématurée/mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/accuweather: ligne 888: erreur de syntaxe : fin de fichier prématurée
-------------------------------
/mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/accuweather: line 888: syntax error: end of file encountered prematurelyLast edited by loutch (Yesterday 18:57:50)
Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX
Offline
^ I'm sorry, but I can't search for a syntax error.
I see you didn't replace the line in #### Marens Hourly.
Replace:
#Icons
cat /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly | grep '<svg class="icon" data-src="/images/weathericons/' | awk '{print $3}' | awk -F'weathericons/' '{print $2}' | sed -r 's/.{5}$//' | sed s'/v2a\///g' > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/iconswith:
#Icons
cat /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/hourly | grep -o '[ ^]src="/images/weathericons/v2a/[^"]*' | awk -F'v2a/' '{print $2}' | sed 's/^0*//' | sed 's/.svg//' > /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script/marens_hourly/iconsI hope you made a copy of the accuweather script first.
It might be best to restore the original $HOME/Accuweather_conky_script paths first and then do my fixes.
After that replace the paths with /mnt/9d01359b-9705-43f9-be12-4d6d7f28b12b/Accuweather/Accuweather_conky_script.
As you can see, the accuweather script is located deep in my ~/.conky folder, but for beginners I always use the default location.
There are no errors in the terminal:
Hourly Forecast
$ bash $HOME/.conky/SM*AccuWeather*Icons/Accuweather_conky_script/accuweather -h2015
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 43864 0 43864 0 0 164k 0 --:--:-- --:--:-- --:--:-- 164k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 44040 0 44040 0 0 167k 0 --:--:-- --:--:-- --:--:-- 167kDaily Forecast
$ bash $HOME/.conky/SM*AccuWeather*Icons/Accuweather_conky_script/accuweather -f2015
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 42725 0 42725 0 0 102k 0 --:--:-- --:--:-- --:--:-- 102k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 42674 0 42674 0 0 99k 0 --:--:-- --:--:-- --:--:-- 99kGood luck!
If people would know how little brain is ruling the world, they would die of fear.
Offline