You are not logged in.

#4401 2024-02-01 10:25:18

loutch
Member
Registered: 2015-12-12
Posts: 848

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Hello guys

Could I have the latest script accuweather with all the changes of marens, mine is again messing up, thank you in advance.


@+


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

#4402 2024-02-01 10:53:28

il.harun
Member
Registered: 2020-06-04
Posts: 54

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Hello marens.
My version:

#####################  old  ##############################
#	for (( i=2; i<=8; i+=3 ))
#	    do
#	        im=$(sed -n ${i}p $HOME/Accuweather_RSS_conky_script/weather)
#	        sed -i $i"s/^.*$/$(test_image $im)/" $HOME/Accuweather_RSS_conky_script/weather
#	    done
#####################  new  ###############################

	     j=1
	for (( i=2; i<=8; i+=3 ))
	    do
	      cp $HOME/Accuweather_RSS_conky_script/images/weather_themesV2/liquid/$(sed -n ${i}p $HOME/Accuweather_RSS_conky_script/weather | awk '{print int($1)}').png $HOME/Accuweather_RSS_conky_script/day_$j.png

	      im=$(sed -n ${i}p $HOME/Accuweather_RSS_conky_script/weather)
	      sed -i $i"s/^.*$/$(test_image $im)/" $HOME/Accuweather_RSS_conky_script/weather
	    ((j++))
	    done

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

Offline

#4403 2024-02-01 16:43:58

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Thank you @il.harun.
Elegant solution as always.
Now we can have both accuwether icon themes with PNG images.

Thanks for reminding me about the liquid icon theme.
I went back many years when I was using Xubuntu and the awesome weather plugin.

weather3.png

Let's start all over again.
Delete the ~/Accuweather_RSS_conky_script/weather_2015 folder.
Create a folder images.
Open ~/Accuweather_conky_script folder and copy Forecast_Images_2015 and Forecast_Images_2016.
Paste to ~/Accuweather_RSS_conky_script/images.

Open ~/Accuweather_RSS_conky_script/acc_RSS and delete my plugin at the end of the script (Convert WeatherFont to PNG images).

Then find the part:

	for (( i=2; i<=8; i+=3 ))
	    do
	        im=$(sed -n ${i}p $HOME/Accuweather_RSS_conky_script/weather)
	        sed -i $i"s/^.*$/$(test_image $im)/" $HOME/Accuweather_RSS_conky_script/weather
	    done

Replace with:

        for (( i=2; i<=8; i+=3 ))
	    do
	      cp $HOME/Accuweather_RSS_conky_script/images/Forecast_Images_2015/$(sed -n ${i}p $HOME/Accuweather_RSS_conky_script/weather | awk '{print int($1)}').png $HOME/Accuweather_RSS_conky_script/day_$j.png

	      im=$(sed -n ${i}p $HOME/Accuweather_RSS_conky_script/weather)
	      sed -i $i"s/^.*$/$(test_image $im)/" $HOME/Accuweather_RSS_conky_script/weather
	    ((j++))
	    done	    

Done.

Restart conky.

Are the images day_1.png (Now), day_2.png (Today) and day_3.png (Tomorrow) there?

If you want you can use Forecast_Images_2016:

	      cp $HOME/Accuweather_RSS_conky_script/images/Forecast_Images_2016/$(sed -n ${i}p $HOME/Accuweather_RSS_conky_script/weather | awk '{print int($1)}').png $HOME/Accuweather_RSS_conky_script/day_$j.png

weather1.png    weather2.png

Last edited by marens (2024-02-01 16:46:34)


If people would know how little brain is ruling the world, they would die of fear.

Offline

#4404 2024-02-01 21:58:29

ceeslans
Member
Registered: 2015-09-30
Posts: 195

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

I kinda like the conkyweather font best for the accuweather-RSS script...

kaqNuTHt.png

Offline

#4405 2024-02-01 23:29:29

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

^ Of course I accept and respect your opinion.

I also think it's good to have a choice.
Now anyone who wants can easily create a new conky with accuweather PNG images (2015 or 2016).
If he doesn't want to, it's fine.

Last edited by marens (2024-02-01 23:30:06)


If people would know how little brain is ruling the world, they would die of fear.

Offline

#4406 2024-02-02 12:53:45

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

ceeslans wrote:

I kinda like the conkyweather font best for the accuweather-RSS script...

Could not agree with you more.  Simple and elegant.

2024-02-02-092225.jpg
Two formats
2024-02-02-092225-1.jpg
And just plain works!!


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#4407 2024-02-02 16:48:58

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,640

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

marens wrote:

Thank you @il.harun.
Elegant solution as always.
Now we can have both accuwether icon themes with PNG images.

Thanks for reminding me about the liquid icon theme.
I went back many years when I was using Xubuntu and the awesome weather plugin.

https://i.postimg.cc/cvWVX59g/weather3.png

Let's start all over again.
Delete the ~/Accuweather_RSS_conky_script/weather_2015 folder.
Create a folder images.
Open ~/Accuweather_conky_script folder and copy Forecast_Images_2015 and Forecast_Images_2016.
Paste to ~/Accuweather_RSS_conky_script/images.

Open ~/Accuweather_RSS_conky_script/acc_RSS and delete my plugin at the end of the script (Convert WeatherFont to PNG images).

Then find the part:

	for (( i=2; i<=8; i+=3 ))
	    do
	        im=$(sed -n ${i}p $HOME/Accuweather_RSS_conky_script/weather)
	        sed -i $i"s/^.*$/$(test_image $im)/" $HOME/Accuweather_RSS_conky_script/weather
	    done

Replace with:

        for (( i=2; i<=8; i+=3 ))
	    do
	      cp $HOME/Accuweather_RSS_conky_script/images/Forecast_Images_2015/$(sed -n ${i}p $HOME/Accuweather_RSS_conky_script/weather | awk '{print int($1)}').png $HOME/Accuweather_RSS_conky_script/day_$j.png

	      im=$(sed -n ${i}p $HOME/Accuweather_RSS_conky_script/weather)
	      sed -i $i"s/^.*$/$(test_image $im)/" $HOME/Accuweather_RSS_conky_script/weather
	    ((j++))
	    done	    

Done.

Restart conky.

Are the images day_1.png (Now), day_2.png (Today) and day_3.png (Tomorrow) there?

If you want you can use Forecast_Images_2016:

	      cp $HOME/Accuweather_RSS_conky_script/images/Forecast_Images_2016/$(sed -n ${i}p $HOME/Accuweather_RSS_conky_script/weather | awk '{print int($1)}').png $HOME/Accuweather_RSS_conky_script/day_$j.png

https://i.postimg.cc/CB9GJX4W/weather1.png    https://i.postimg.cc/xqhQy5VM/weather2.png


Thank you, @marens.
I will definitely try it out with 'Forecast_Images_2016'.  big_smile

Offline

#4408 2024-02-03 14:53:27

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

@ceeslans

From your screenshot I can see (Currently): Mostly Cloudy: 10C without '°'.
If you want Mostly Cloudy: 10°C you can use the command:

$ sed -n '1p' $HOME/Accuweather_RSS_conky_script/weather | awk 'NF>1{print $NF}' | sed 's/C/°C/g'
10°C

How to get to Mostly Cloudy:

$ sed -n '1p' $HOME/Accuweather_RSS_conky_script/weather | awk '{$NF="";sub(/[ \t]+$/,"")}1' | awk '{$1=""; print $0}' | awk '{print substr($0,2)}'
Mostly Cloudy:

Explanation:
awk '{$NF="";sub(/[ \t]+$/,"")}1'  -  Remove the last word
awk '{$1=""; print $0}'            -  Remove the first word (Currently:)
awk '{print substr($0,2)}'         -  Remove the blank space at the beginning

Last edited by marens (2024-02-03 18:45:53)


If people would know how little brain is ruling the world, they would die of fear.

Offline

#4409 2024-02-04 09:47:52

asqwerth
Member
Registered: 2015-10-08
Posts: 24

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Useful to know, @marens.

So far I've just been using "|cut" to remove the 1st 11 characters (ie, "Currently: ").  I don't mind just having C and not °C.

Offline

#4410 2024-02-04 13:36:19

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

^ I think the current description of weather is always short.
The longest is: Intermittent Clouds (accuweather conky script).

You can try if you want, but first make a copy of conky.

Find this part:

${goto 75}${voffset -25}${execpi 600 sed -n '1p' $HOME/Accuweather_RSS_conky_script/weather|cut -c1-20}
${goto 75}${execpi 600 sed -n '1p' $HOME/Accuweather_RSS_conky_script/weather|cut -c21-40}
${goto 75}${execpi 600 sed -n '1p' $HOME/Accuweather_RSS_conky_script/weather|cut -c41-60}

Replace with:

${goto 75}${voffset -25}Currently:
${goto 75}${execpi 600 sed -n '1p' $HOME/Accuweather_RSS_conky_script/weather | awk '{$NF="";sub(/[ \t]+$/,"")}1' | awk '{$1=""; print $0}' | awk '{print substr($0,2)}' | cut -c1-30} ${execpi 600 sed -n '1p' $HOME/Accuweather_RSS_conky_script/weather | awk 'NF>1{print $NF}' | sed 's/C/°C/g'}

Increase the minimum conky width a little (and other things) and test.
If you fail you have a copy of conky.


If people would know how little brain is ruling the world, they would die of fear.

Offline

#4411 2024-02-04 15:02:10

asqwerth
Member
Registered: 2015-10-08
Posts: 24

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

I'm using the accuRSS script to display current weather/temp in a simple horizontal conky.

I think I'll stick to

".... |cut -c12-45}". 

The RSS current-weather text is, as you say, short.  So giving the text an allowance of up to (45-12+1) characters is more than enough.  It makes no difference to the conky display if the text is shorter than that .  I don't want to complicate my conky config.

I did learn a little more about awk syntax though, so thanks!

Offline

#4412 2024-02-04 18:40:07

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

^ I always have to pay attention to beginners.
That's why I only use the basic version.

In this case I wanted to make available the excellent forecast images of accuweather conky script (2015 and 2016).
The "°C" part appeared unintentionally.

I think I successfully solved both cases.

This is how it looks (for now):

RSS-weather1.png  RSS-weather2.png


If people would know how little brain is ruling the world, they would die of fear.

Offline

#4413 2024-02-04 19:31:49

ceeslans
Member
Registered: 2015-09-30
Posts: 195

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

@marens : Ooohh, I've been looking for a way to change the current 'C' into '°C' - but my attempts always failed miserably....
Thanks for the fresh code - and the explanatory notes !

Offline

#4414 2024-02-05 01:55:57

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Another option to get the " °C " in the output for today's and tomorrow's forecasts, that IMHO is a little cleaner:

Line 4 - today's forecast

${goto 75}${execpi 600 sed -n '4p' /media/5/Conky/accuweather_rss/weather|awk '{print $1,$2"'°C'",$4,$5"'°C'"}'}
${goto 75}${execpi 600 sed -n '4p' /media/5/Conky/accuweather_rss/weather|cut -d ' ' -f7-|fold -s -w26}]

Line 7 - tomorrows forecast

${goto 75}${execpi 600 sed -n '7p' /media/5/Conky/accuweather_rss/weather|awk '{print $1,$2"'°C'",$4,$5"'°C'"}'}
${goto 75}${execpi 600 sed -n '7p' /media/5/Conky/accuweather_rss/weather|cut -d ' ' -f7-|fold -s -w26}]

Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#4415 2024-02-05 02:27:59

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

This part I quite like:

${font conkyweather:size=30}${color8}${execpi 600  sed -n '2p' /media/5/Conky/accuweather_rss/weather}${color}${font}
${voffset -10}${goto 75}${color1}BsAS Arg.${color}
${execpi 600 sed -n '1p' /media/5/Conky/accuweather_rss/weather | awk '{$NF="";sub(/[ \t]+$/,"")}1' | awk '{$1=""; print $0}' | awk '{print substr($0,2)}' | cut -c1-30} \
${execpi 600 sed -n '1p' /media/5/Conky/accuweather_rss/weather | awk 'NF>1{print $NF}' | sed 's/C/°C/g'}

Thank you marens


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#4416 2024-02-05 08:35:25

asqwerth
Member
Registered: 2015-10-08
Posts: 24

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

marens wrote:

.....
In this case I wanted to make available the excellent forecast images of accuweather conky script (2015 and 2016)....

I have just tested the RSS script addition that allows the 2016 Images to be displayed.  Very nice. Thank you.

Offline

#4417 2024-02-05 13:31:18

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

ceeslans wrote:

@marens : Ooohh, I've been looking for a way to change the current 'C' into '°C' - but my attempts always failed miserably....
Thanks for the fresh code - and the explanatory notes !

Do not worry.
It happens to everyone.
Mental block, fatigue, concentration, mood ...

I don't know the reason why this 'error' exists?
Maybe the developer of accuweather just made a typo years ago.


@Sector11

marens wrote:

^ I think the current description of weather is always short.
The longest is: Intermittent Clouds (accuweather conky script).

If my assumption is correct (based on accuweather conky script) then no command is needed: cut -c1-30.

This is the beginning of my SysInfo conky:

SysInfo.png

Space is very limited but a 'jump' has never happened.


If people would know how little brain is ruling the world, they would die of fear.

Offline

#4418 2024-02-05 16:22:20

asqwerth
Member
Registered: 2015-10-08
Posts: 24

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

@marens - found something relevant to the AccuRSS discussion.

I examined a conky config posted to MX forum long ago that utilised the AccuRSS script.  The poster had a shorter way to display just the current weather description without the "Currently" nor the temperature.

${execpi 600 sed -n '1p' $HOME/Accuweather_RSS_conky_script/weather|awk -F: 'NF>1{print $2}'}

After doing some reading on awk basics, I see that he defined the colons in line 1 of the weather file as the field separators, such that the whole weather description is field 2.

Offline

#4419 2024-02-05 17:23:46

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

^ There is no one who can remember all the commands.
Things are simple.
When you need something, you try to find it.
It is important that you achieve what you are trying to do.

That command works:

$ sed -n '1p' $HOME/Accuweather_RSS_conky_script/weather|awk -F: 'NF>1{print $2}'
 Mostly Sunny

It creates an empty space at the beginning, but that is easily solved in conky.

For me, the best conky is the one you make yourself.
Sometimes it's fun, sometimes it's frustrating, but it's all part of the learning process.
Enjoy!


If people would know how little brain is ruling the world, they would die of fear.

Offline

#4420 2024-02-05 18:03:53

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

marens wrote:

@Sector11
This is the beginning of my SysInfo conky:

https://i.postimg.cc/GTxHxLX3/SysInfo.png

Space is very limited but a 'jump' has never happened.

My "RSS script" has been running since 2014 with minor tweaks to layout etc only because I ignored it for a few years until Teo started dropping support for other scripts did I start playing with it, as the others were changing way too often.  He said he used Accu_RSS and it never failed him.
That was good enough for me, I'm old I want 'stability'!

# tweaking conky NOT the script.
# works perfect - Sun 04 Feb 2024 15:51:21- tweaked conky NOT script.
# works perfect - Fri 12 Jan 2024 23:42:07 - 10 years later!
# works perfect - Fri 09 Oct 2015 15:41:56
# works perfect - Fri 10 Apr 2015 10:17:05
# works perfect - Sat 24 Jan 2015 23:04:11
# works perfect - Mon 24 Nov 2014 23:42:07

Teo's Accu_RSS script on the right with 2 layouts and Accu-RSS, Openweather and 'remind' for sun|moon data on the left.  The one on the left is a few years old now as well.

Screenshot
Screenshot - daily run


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

Board footer

Powered by FluxBB