You are not logged in.

#4381 2023-11-05 17:08:28

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

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

@GioD, welcome to the BunsenLabs forums.


GioD wrote:

maybe I'm missing something out here, but from what I see, you just want to know what the time in UTC is, right?

Yes indeed, thank you.

It seems that it was easier for me to make a script instead:

$ man date

Next:

GioD wrote:

which is simply the very same out as il.haruns's one.liner

Yes, both solutions work well.

$ date -u +%Y-%m-%dT%H:%M:%SZ

I checked two cutom locations:

$ TZ='Australia/Melbourne' date -u +%Y-%m-%dT%H:%M:%S
2023-11-05T16:45:34
$ TZ='America/Argentina/Buenos_Aires' date -u +%Y-%m-%dT%H:%M:%S
2023-11-05T16:46:16

This command also helps where the time difference from UTC is calculated by half an hour (India - UTC+05:30):
https://en.wikipedia.org/wiki/Asia/Kolkata

I hope we have now resolved the moon position, illumination angle and visibility for all locations.

This part:

#Daylight saving time
sign=$(date +%z | sed 's/\(.\{1\}\).*/\1/')
dz=$(date +%z | sed 's/^.//' | sed 's/\(.\{2\}\).*/\1/' | sed 's/^0\(.*\)/\1/')

if [[ "$sign" == "+" ]]; then
   dst=$(echo 0-$dz | bc)      
else      
   dst=$(echo $dz)   
fi
   
date=$(date -d "$dst hour" "+%Y-%m-%dT%H:%M:%SZ")

Replace again with 'one-liner':

date=$(date -u +%Y-%m-%dT%H:%M:%SZ)

Thanks to @il.harun and @GioD for the suggestions.


P.S.
I edited my plugin for the Moongiant conky script:
https://forums.bunsenlabs.org/viewtopic … 46#p128546

Last edited by marens (2023-11-05 17:44:21)


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

Offline

#4382 2023-11-05 18:26:49

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

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

asqwerth wrote:

But the conkyweather font symbols are back to normal.  Looks like it was a temporary glitch. At least for now.

I sincerely hope it stays that way for a long time.


EDIT
Maybe this is the cause of the errors:
https://forums.bunsenlabs.org/viewtopic … 99#p129399

See the end of the post (about Accuweather developers).
Errors occur when moon data is 'not available'.


P.S.
You may be interested in this Firefox Bunsenlabs start (home) page with weather forecast:
https://forums.bunsenlabs.org/viewtopic.php?id=8704

Last edited by marens (2023-11-13 18:12:47)


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

Offline

#4383 2023-11-16 09:28:29

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

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

marens wrote:

I sincerely hope it stays that way for a long time.


EDIT
Maybe this is the cause of the errors:
https://forums.bunsenlabs.org/viewtopic … 99#p129399

See the end of the post (about Accuweather developers).
Errors occur when moon data is 'not available'.


P.S.
You may be interested in this Firefox Bunsenlabs start (home) page with weather forecast:
https://forums.bunsenlabs.org/viewtopic.php?id=8704

Thank you, marens.  I had not noticed your post about accuweather moon data errors, because my conkies using accuweather script usually don't include moon data (even with moongiant, I only use the data/image for the present day's moonphase).  Nevertheless I have updated my script.

The Firefox start page is a cool idea, thank you.

Offline

#4384 2023-11-16 18:16:55

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

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

asqwerth wrote:

... because my conkies using accuweather script usually don't include moon data (even with moongiant, I only use the data/image for the present day's moonphase).  Nevertheless I have updated my script.

You did it well.
It doesn't matter that you don't use the moon data from the accuweather script.
In short, those errors change the current condition file and some other data is incorrect.


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

Offline

#4385 2023-11-30 15:50:16

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

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

Unfortunately, gismeteo developers changed something and Gis Weather does not work properly.
I managed to find a solution this time.
It works fine for now.

Open ~/Downloads/gis-weather-master/services/gismeteo.py file.

Find this part:

    # day of week, date
    day = re.findall('<day.*? date="(.*?)"', source)
    day.pop(0)
    for i in range(len(day)):
        dt1 = datetime.strptime(day[i], '%Y-%m-%d')
        day[i] = dt1.strftime('%a')
    date = re.findall('<day.*? date=".*?-(.*?)"', source)
    date.pop(0)
    for i in range(len(date)):
        s = date[i].split('-')
        date[i] = s[1]+'.'+s[0]

Replace with:

    # day of week, date
    #day = re.findall('<day.*? date="(.*?)"', source)
    day = re.findall('<day date="(.*?)"', source)  # Marens Settings
    #day.pop(0)
    for i in range(len(day)):
        dt1 = datetime.strptime(day[i], '%Y-%m-%d')
        day[i] = dt1.strftime('%a')
    #date = re.findall('<day.*? date=".*?-(.*?)"', source)
    date = re.findall('<day date=".*?-(.*?)"', source)  # Marens Settings
    #date.pop(0)
    for i in range(len(date)):
        s = date[i].split('-')
        date[i] = s[1]+'.'+s[0]

Restart Gis Weather.
Visit your location on gismeteo.com and check if the weather forecast  is the same as shown by Gis Weather.

gis-weather.png


P.S.               
I don't know if (when) author Gis Weather will fix it.
The last post was on February 27, 2022:
https://github.com/RingOV/gis-weather

Last edited by marens (2023-11-30 18:01:44)


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

Offline

#4386 2023-12-03 00:40:30

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

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

Good news for Gis Weather fans.
The app was updated last night.
The author @RingOV (Alexander Koltsov) from GitHub, as always, responded quickly.
It's nice to know that the support continues.

His solution is similar to mine and basically the same (choose which one you want):

    # day of week, date
    day = re.findall('<day.*? date="(.*?)"', source)
    # day.pop(0)
    for i in range(len(day)):
        dt1 = datetime.strptime(day[i], '%Y-%m-%d')
        day[i] = dt1.strftime('%a')
    date = re.findall('<day.*? date=".*?-(.*?)"', source)
    # date.pop(0)
    for i in range(len(date)):
        s = date[i].split('-')
        date[i] = s[1]+'.'+s[0]

He also changed the version name to '0.8.4.21' instead '0.8.4.20'.
Open gis-weather.py file (line 4) and replace to:

v = '0.8.4.21'

This way you will save all the settings I have posted here.       
Otherwise, you may have to go back to the beginning and do everything again.

If you are not using my settings just allow check for updates option (right click on Gis Weather window > Preferences).


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

Offline

#4387 2023-12-06 14:40:05

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

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

OK.
Gis Weather is working again.

But it's not the same as before.

marens wrote:

Unfortunately, gismeteo developers changed something ...

Have you noticed the new 'no precipitation' style?
I don't understand why if we have weather icons that ’say’ no precipitation?

new-style.png

If you like the new 'no precipitation' style just skip the rest of post.

Let's try to bring back the old style without 'no precipitation'.

Open gis-weather.py file.

Block Now

Find:

if text_now and text_now_attr['show']: self.draw_text(cr, text_now[0], text_now_x+center-70+block_now_left,

Replace with:

if text_now and text_now_attr['show']: self.draw_text(cr, text_now[0].replace(', no precipitation', ''), text_now_x+center-70+block_now_left,  # Marens Settings - Added .replace(', no precipitation', '')

Block Daily

Find:

if text_attr['show']: self.draw_text(cr, text[index], x+text_attr['x'], y+text_attr['y']+v_offset, font+desc_list[desc_style],

Replace with:

if text_attr['show']: self.draw_text(cr, text[index].replace(', no precipitation', ''), x+text_attr['x'], y+text_attr['y']+v_offset, font+desc_list[desc_style],  # Marens Settings - Added .replace(', no precipitation', '')

Done.

Restart Gis Weather.

Old style:
old-style.png


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

Offline

#4388 2023-12-07 11:23:49

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

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

^ Thank you Sir

Offline

#4389 2023-12-27 14:45:52

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

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

I've been using Weezle weather icons for a long time in my modified icon theme.
That's not a problem because only a dozen icons are used.
About fifty is needed for Gis Weather.
Luckily I found a folder with original Weezle icons in my archive and tried to adapt them for Gis Weather.

widget.png  appindicator.png

If you like, you can download it:
https://workupload.com/file/p4XMTa9xYRw

Extract the Weezle.tar.xz file in ~/Downloads and copy/paste the Weezle folder into Gis Weather > themes > icons.

Done.

Restart Gis Weather, right click on Gis Weather window > Icons > Weezle.

If you use Gis Weather in the panel, right click on Gis Weather window > Preferences > Indicator > Icons:

preferences.png

I honestly think the VClouds icons are better for the widget but the Weezle icons look good in the panel.
Tastes vary and it's good to have more icon themes.


EDIT

Small correction for Mainly cloudy, rain icon:
Delete the 40.png icon and create a new one by copying the 01.png and renaming it to the new 40.png.

Repeat the same in the stock folder.

Last edited by marens (2024-01-02 00:08:54)


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

Offline

#4390 2024-01-02 00:34:18

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

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

If you use Gis Weather as a panel indicator (AppIndicator3), you can increase the space between the weather icon and the temperature in the panel.

Open gis-weather.py file.

Find:

tt = weather['t_now'][0].split(';')[t_index]

Replace with:

tt = (' '+weather['t_now'][0].split(';')[t_index])  # Marens Settings

Restart Gis Weather.


You have a screenshot above.


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

Offline

#4391 2024-01-06 13:59:01

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

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

Wrong date again.
As far as I can see, the gismeteo developers have gone back to the old way.

Open ~/Downloads/gis-weather-master/services/gismeteo.py file.

That part should look like this again:

    # day of week, date
    day = re.findall('<day.*? date="(.*?)"', source)
    day.pop(0)
    for i in range(len(day)):
        dt1 = datetime.strptime(day[i], '%Y-%m-%d')
        day[i] = dt1.strftime('%a')
    date = re.findall('<day.*? date=".*?-(.*?)"', source)
    date.pop(0)
    for i in range(len(date)):
        s = date[i].split('-')
        date[i] = s[1]+'.'+s[0]

EDIT

gis1.png  gis2.png


Those who don't use my settings can wait for the update if they want.

Last edited by marens (2024-01-06 14:30:35)


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

Offline

#4392 2024-01-07 07:37:26

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

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

Thanks again for that updated code

Offline

#4393 2024-01-11 17:19:19

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

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

ceeslans wrote:

Thanks again for that updated code

Thank you for following and sending feedback.


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

Offline

#4394 2024-01-11 17:25:36

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

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

Those who downloaded my adapted Weezle icon theme are probably wondering what the CLM_small.png icon is?

You know that there is no wind icon when it is Calm (no wind).
It is an icon in the Block Additional Info (Wind, Pressure, Humidity ...) when there is no wind:
https://postimg.cc/kVks4Fnm

If you like it open gis-weather.py file:

Find:

                if icon_wind_now[0] != 'None':
                    if DISTRO:
                        bv = distro.linux_distribution()[0] == 'debian'

Add above:

                if icon_wind_now[0] == 'None':         
                        self.draw_scaled_image(cr, x0, y0, self.find_icon('CLM_small'), 16, 16)

Copy/Paste the CLM_small.png icon into the theme you are using.

Done.


Now wait for Calm or try the simulation:
https://forums.bunsenlabs.org/viewtopic … 77#p128677

* Sometimes the simulation may not work properly.
  Test again after a few hours.


P.S.
Gis Weather is not yet updated on GitHub:
https://github.com/RingOV/gis-weather/commits/master


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

Offline

#4395 2024-01-13 00:14:11

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

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

marens wrote:

... gismeteo developers have gone back to the old way.

I decided to test this and YES.
No more 'no precipitation' style.

If you want, you can restore the old code from this post:
https://forums.bunsenlabs.org/viewtopic … 16#p130716

My advice is to wait anyway.
Maybe something will change again tomorrow.


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

Offline

#4396 2024-01-31 00:04:14

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

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

Accuweather_RSS_conky_script

This script is a bit neglected probably because it always works.
It is very easy to insert data into any conky (weather, SysInfo... ).
It uses the conkyweather font.

weather1.png

I don't like conky with black semi-transparent background and white/grey letters.
In this case there is not much choice.
If you set the font color to yellow, you will get a nice sun, but then the clouds are also yellow.
If you set the font color to blue, you will get a nice clouds, but then the sun are also blue.

Can we change that?
My answer is YES.

We need to convert conkyweather font to PNG images,but let's go in order.

Download the weather_2015.tar.xz file:
https://workupload.com/file/FAjsqqAGprR

Extract to ~/Downloads and you will get weather_2015 folder with accuweather images (2015).
Copy/Paste it to $HOME/Accuweather_RSS_conky_script folder.

* Note:
I am not familiar with conkyweather font symbols and it is possible that some PNG images are not appropriate, but you can easily correct this during testing.
Some images are missing, for example wind, fog ...
I hope someone will complete all the PNG images and post them here.
I'm just trying to point you in the right direction.
It is important that we know the principle of how to arrive at a solution.

Open $HOME/Accuweather_RSS_conky_script/acc_RSS file (script) and add at the end of the script:

#### Marens - Convert WeatherFont to PNG images

rm $HOME/Accuweather_RSS_conky_script/*.png

forecast_0=$(sed -n '2p' $HOME/Accuweather_RSS_conky_script/weather)
forecast_1=$(sed -n '5p' $HOME/Accuweather_RSS_conky_script/weather)
forecast_2=$(sed -n '8p' $HOME/Accuweather_RSS_conky_script/weather)

cp $HOME/Accuweather_RSS_conky_script/weather_2015/"$forecast_0".png $HOME/Accuweather_RSS_conky_script/forecast_0.png
cp $HOME/Accuweather_RSS_conky_script/weather_2015/"$forecast_1".png $HOME/Accuweather_RSS_conky_script/forecast_1.png
cp $HOME/Accuweather_RSS_conky_script/weather_2015/"$forecast_2".png $HOME/Accuweather_RSS_conky_script/forecast_2.png

Done.

Restart conky.

Open $HOME/Accuweather_RSS_conky_script folder.
Are the images forecast_0 (now), forecast_1 (today) and forecast_2 (tomorrow) there?

If they are, I'm sure you know how to use them in any conky.

A simple example Accuweather_RSS_PNG conky is the same as the basic one (config).
Only the TEXT has been changed:

${color 48bcff}WEATHER ${hr 1}$color${execi 600 bash $HOME/Accuweather_RSS_conky_script/acc_RSS}



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

${color 48bcff}${execi 600  sed -n '3p' $HOME/Accuweather_RSS_conky_script/weather}$color


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

${color 48bcff}${execi 600  sed -n '6p' $HOME/Accuweather_RSS_conky_script/weather}$color


${goto 100}${voffset -25}${execpi 600 sed -n '7p' $HOME/Accuweather_RSS_conky_script/weather|cut -c1-20}
${goto 100}${execpi 600 sed -n '7p' $HOME/Accuweather_RSS_conky_script/weather|cut -c21-40}
${goto 100}${execpi 600 sed -n '7p' $HOME/Accuweather_RSS_conky_script/weather|cut -c41-60}\
${image $HOME/Accuweather_RSS_conky_script/forecast_0.png -p 0,35 -s 90x54}\
${image $HOME/Accuweather_RSS_conky_script/forecast_1.png -p 0,130 -s 90x54}
${image $HOME/Accuweather_RSS_conky_script/forecast_2.png -p 0,225 -s 90x54}

From my configuration:
imlib_cache_size 0
minimum_size 200 0

weather2.png    weather3.png


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

Offline

#4397 2024-01-31 02:52:33

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

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

Thank you for sharing your tweaks/new additions to existing scripts/programs.

I still use TeoBG's scripts for accuweather (with your recent adjustments) and accuRSS, but I accept that they may not last indefinitely. I also use alternatives like openweathermap data and gisweather, but it will be sad day if accuweather/accuRSS dies.

Offline

#4398 2024-01-31 09:26: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)

asqwert wrote:

...
but it will be sad day if accuweather/accuRSS dies.

accuweather is not dying!  ISmdM7V.png

Offline

#4399 2024-01-31 10:29:37

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

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

unklar wrote:
asqwert wrote:

...
but it will be sad day if accuweather/accuRSS dies.

accuweather is not dying!  https://i.imgur.com/ISmdM7V.png


Oops.

Rewording my comment - My fear is that the TBG scripts for Accuw/AccuRSS may one day be rendered useless if Accuweather cuts off access or completely revamps their API or drastically switches things around in the organisation of weather data.

Offline

#4400 2024-01-31 13:03:10

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)

asqwerth wrote:
unklar wrote:
asqwert wrote:

...
but it will be sad day if accuweather/accuRSS dies.

accuweather is not dying!  https://i.imgur.com/ISmdM7V.png


Oops.

Rewording my comment - My fear is that the TBG scripts for Accuw/AccuRSS may one day be rendered useless if Accuweather cuts off access or completely revamps their API or drastically switches things around in the organisation of weather data.

Correct!  FdGbhEM.png  tongue

Offline

Board footer

Powered by FluxBB