Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-09-20 11:22:33

tanis73
Member
Registered: 2013-11-25
Posts: 10

Weather plugin no data or xfce panel bug?

Hello there

On my fresh install of debian buster (running under SID repositories), the weather plugin does'nt work. When I click right, the box show a greyed weather update and panel with log out/help and about. A left click will open a big box asking to set a location but I only can close the box.
Plugin has been downgraded to 0.8 without effect, reinstalled to 0.10 version.
I thinking about a bug with the xfce panel, when I click on the clock, this one desappear but always displayed on the panel settings box

# apt-cache policy xfce4-weather-plugin
xfce4-weather-plugin:
  Installed: 0.10.1-1+b1
  Candidate: 0.10.1-1+b1
  Version table:
 *** 0.10.1-1+b1 900
        900 http://ftp.fr.debian.org/debian unstable/main amd64 Packages
        100 /var/lib/dpkg/stable
     0.8.10-1 700
        700 http://deb.debian.org/debian buster/main amd64 Packages

Any helps/advices are welcome

Offline

#2 2020-09-20 19:15:20

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Weather plugin no data or xfce panel bug?

There is a bug with the weather panel - the weather API that is used was changed (this happens frequently). It has been fixed in the git tree so you'll need to wait for an upgrade.

As an alternative, you can use the genmon plugin as a script like the following (which parses wttr.in information):

#!/bin/bash

SITE="Toronto"
LATITUDE="43.651070"
LONGITUDE="-79.347015"

CLICK_COMMAND="xfce4-terminal -H --geometry=126x41 -T "Weather" -x curl -s wttr.in/$LATITUDE,$LONGITUDE"

function toDate
{
    HOUR=$(echo $1 | awk -F':' '{print $1}')
    MINUTE=$(echo $1 | awk -F':' '{print $2}')
    
    case $HOUR in
        "00") HOUR="12" AMPM="am" ;;
        "01") HOUR="1"  AMPM="am" ;;
        "02") HOUR="2"  AMPM="am" ;;
        "03") HOUR="3"  AMPM="am" ;;
        "04") HOUR="4"  AMPM="am" ;;
        "05") HOUR="5"  AMPM="am" ;;
        "06") HOUR="6"  AMPM="am" ;;
        "07") HOUR="7"  AMPM="am" ;;
        "08") HOUR="8"  AMPM="am" ;;
        "09") HOUR="9"  AMPM="am" ;;
        "10") HOUR="10" AMPM="am" ;;
        "11") HOUR="11" AMPM="am" ;;
        "12") HOUR="12" AMPM="am" ;;
        "13") HOUR="1"  AMPM="pm" ;;
        "14") HOUR="2"  AMPM="pm" ;;
        "15") HOUR="3"  AMPM="pm" ;;
        "16") HOUR="4"  AMPM="pm" ;;
        "17") HOUR="5"  AMPM="pm" ;;
        "18") HOUR="6"  AMPM="pm" ;;
        "19") HOUR="7"  AMPM="pm" ;;
        "20") HOUR="8"  AMPM="pm" ;;
        "21") HOUR="9"  AMPM="pm" ;;
        "22") HOUR="10" AMPM="pm" ;;
        "23") HOUR="11" AMPM="pm" ;;
    esac
    
    echo "$HOUR:$MINUTE $AMPM"
}

OUT=$(curl -s wttr.in/$LATITUDE,$LONGITUDE?format="%c\n%h\n%t\n%f\n%w\n%l\n%m\n%M\n%p\n%P\n%D\n%S\n%z\n%s\n%d\n%C\n")

WEATHERICON=$(echo $OUT | awk '{print $1}')
HUMIDITY=$(echo $OUT | awk '{print $2}')
TEMPERATURE=$(echo $OUT | awk '{print $3}' | sed -e 's/+//g' | sed -e 's/^-0/0/g' )
FEELSLIKE=$(echo $OUT | awk '{print $4}' | sed -e 's/+//g' | sed -e 's/^-0/0/g' )
WIND=$(echo $OUT | awk '{print $5}')
LOCATION=$(echo $OUT | awk '{print $6}')
MOONPHASE=$(echo $OUT | awk '{print $7}')
MOONDAY=$(echo $OUT | awk '{print $8}')
PRECIPITATION=$(echo $OUT | awk '{print $9}')
PRESSURE=$(echo $OUT | awk '{print $10}')
DAWN=$(toDate "$(echo $OUT | awk '{print $11}')")
SUNRISE=$(toDate "$(echo $OUT | awk '{print $12}')")
ZENITH=$(toDate "$(echo $OUT | awk '{print $13}')")
SUNSET=$(toDate "$(echo $OUT | awk '{print $14}')")
DUSK=$(toDate "$(echo $OUT | awk '{print $15}')")
WEATHERCONDITION=$(echo $OUT | awk '{print $16" "$17" "$18}')

if [ "$1" == "debug" ]; then
    echo "OUT=$OUT"
    echo "WEATHERICON=$WEATHERICON"
    echo "HUMIDITY=$HUMIDITY"
    echo "TEMPERATURE=$TEMPERATURE"
    echo "FEELSLIKE=$FEELSLIKE"
    echo "WIND=$WIND"
    echo "LOCATION=$LOCATION"
    echo "MOONPHASE=$MOONPHASE"
    echo "MOONDAY=$MOONDAY"
    echo "PRECIPITATION=$PRECIPITATION"
    echo "PRESSURE=$PRESSURE"
    echo "DAWN=$DAWN"
    echo "SUNRISE=$SUNRISE"
    echo "ZENITH=$ZENITH"
    echo "SUNSET=$SUNSET"
    echo "DUSK=$DUSK"
    echo "WEATHERCONDITION=$WEATHERCONDITION"
fi

#do the genmon
echo -e "<txt><span size='x-large'>$WEATHERICON</span><span rise='0'> $TEMPERATURE</span></txt>"
echo -e "<txtclick>$CLICK_COMMAND</txtclick>"
echo -e "<tool><span font_desc='Bold 16'>$WEATHERICON</span>  <b><big>$SITE</big></b>
$TEMPERATURE <small>and</small> $WEATHERCONDITION
<small>
Feels like:\t$FEELSLIKE
Humidity:\t$HUMIDITY
Wind:\t\t$WIND
Precipitation:\t$PRECIPITATION
Pressure:\t$PRESSURE

Rise/Set:\t$SUNRISE / $SUNSET

Moon:\t\t$MOONPHASE
</small>
<span size='x-small'>$(date)</span></tool>"

exit 0

...just change the SITE, LATITUDE and LONGITUDE values to suit. Clicking on the plugin will open a terminal window with the full 3 day forecast. Add the plugin to the panel. set the time to like 900 seconds (15 minutes) and see if that works for you.

Can you explain more about the clock issue?

Last edited by ToZ (2020-09-28 01:50:24)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2020-09-20 19:56:20

tanis73
Member
Registered: 2013-11-25
Posts: 10

Re: Weather plugin no data or xfce panel bug?

Thank a lot for your return, I will try it.
About the clock, when I click right on it, the timezone is empty, If I complete it and close the dialog box, the clock will disappear from the panel but with dexterity, it's possible to click left and displayed the calendar (with the dark theme, it's possible to see where the clock display was, it's like a big spacer (it takes half of the clock display place approximatively)
Same effects by using the panel settings/items.
Better the open a new post?

Offline

#4 2020-09-20 21:25:37

Mellowbob
Member
Registered: 2011-10-16
Posts: 286

Re: Weather plugin no data or xfce panel bug?

Thanks for the weather report genmon code. I just tried it ...and it sort of works. The panel shows a large icon and % (prob. of rain, I think). No temperature.

But, what is funny is that I was just going to complain the other day about the weather applet not working properly on this site. I even filed a bug report on the gitlab site. But, suddenly it started to work just fine. I have no idea what's going on with this ... and I should add that the kde/plasma app is really nice and lets you select the weather provider you want (in my case Weather Canada) and it is very accurate (well, as far a weather goes!). But, I don't use kde/plasma ... too bloated and to entrenched as to what the developers think I want smile

Offline

#5 2020-09-20 22:35:18

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Weather plugin no data or xfce panel bug?

Mellowbob wrote:

Thanks for the weather report genmon code. I just tried it ...and it sort of works. The panel shows a large icon and % (prob. of rain, I think). No temperature.

It should show the weather icon and the temperature.
What version of the genmon plugin are you using?
Do you mind sharing your Latitude/Longitude values?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#6 2020-09-20 22:39:07

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Weather plugin no data or xfce panel bug?

tanis73 wrote:

Thank a lot for your return, I will try it.
About the clock, when I click right on it, the timezone is empty, If I complete it and close the dialog box, the clock will disappear from the panel but with dexterity, it's possible to click left and displayed the calendar (with the dark theme, it's possible to see where the clock display was, it's like a big spacer (it takes half of the clock display place approximatively)
Same effects by using the panel settings/items.
Better the open a new post?

What timezone  are you setting it to?
What version of xfce4-panel are you running:

xfce4-panel -V

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2020-09-21 09:56:22

Jerry3904
Member
Registered: 2013-11-09
Posts: 863

Re: Weather plugin no data or xfce panel bug?

Our packagers have packaged the new weather plugin so that OP could install it from our repos.


MX-23 (based on Debian Stable) with our flagship Xfce 4.18.

Offline

#8 2020-09-21 17:15:24

Mellowbob
Member
Registered: 2011-10-16
Posts: 286

Re: Weather plugin no data or xfce panel bug?

ToZ wrote:
Mellowbob wrote:

Thanks for the weather report genmon code. I just tried it ...and it sort of works. The panel shows a large icon and % (prob. of rain, I think). No temperature.

It should show the weather icon and the temperature.
What version of the genmon plugin are you using?
Do you mind sharing your Latitude/Longitude values?

Now, this is getting really, really odd. I just tried it again ... and I have not changed the script .. and it's working with the temp being shown. However, the temp value in the panel app and the genmon version show different temps and forecasts.

My location is:
SITE="Creston"
LATITUDE="49.0998"
LONGITUDE="-116.5247"

Offline

#9 2020-09-21 18:47:07

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Weather plugin no data or xfce panel bug?

Mellowbob wrote:

However, the temp value in the panel app and the genmon version show different temps and forecasts.

This is because they are using 2 different sources of weather information. The weather plugin uses met.no and wttr supports a number of different formats, but the default is forecast.io.

References:
- https://github.com/chubin/wttr.in
- https://github.com/schachmat/wego


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#10 2020-09-21 19:31:01

tanis73
Member
Registered: 2013-11-25
Posts: 10

Re: Weather plugin no data or xfce panel bug?

ToZ wrote:

What timezone  are you setting it to?
What version of xfce4-panel are you running:

xfce4-panel -V

I entered europe/paris time zone, my system is set to this timezone

$ xfce4-panel -V
xfce4-panel 4.12.2 (Xfce 4.14)

Copyright (c) 2004-2011
	The Xfce development team. All rights reserved.

Please report bugs to <http://bugzilla.xfce.org/>.

Update:
I must delete the ghosted clock plugin and add it again to dispay the time (this occur only if we try to set a timezone via the dialog box

Last edited by tanis73 (2020-09-21 19:39:33)

Offline

#11 2020-09-21 19:41:07

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Weather plugin no data or xfce panel bug?

tanis73 wrote:
$ xfce4-panel -V
xfce4-panel 4.12.2 (Xfce 4.14)

Copyright (c) 2004-2011
	The Xfce development team. All rights reserved.

Please report bugs to <http://bugzilla.xfce.org/>.

Which distro are you using? xfce4-panel 4.12 is not part of Xfce 4.14. That is a weird output.

There was a bug with the 4.12.x version of the clock where it was crashing during config changes, but those have been fixed in 4.14.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#12 2020-09-21 19:43:30

tanis73
Member
Registered: 2013-11-25
Posts: 10

Re: Weather plugin no data or xfce panel bug?

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux bullseye/sid
Release:	unstable
Codename:	sid

Something wrong? XFCE was installed directly from the CD

$ apt-cache policy xfce4-panel
xfce4-panel:
  Installed: 4.12.2-1
  Candidate: 4.14.4-1
  Version table:
     4.14.4-1 900
        900 http://ftp.fr.debian.org/debian unstable/main amd64 Packages
 *** 4.12.2-1 700
        700 http://deb.debian.org/debian buster/main amd64 Packages
        100 /var/lib/dpkg/status

Last edited by tanis73 (2020-09-21 19:45:58)

Offline

#13 2020-09-21 21:25:50

tanis73
Member
Registered: 2013-11-25
Posts: 10

Re: Weather plugin no data or xfce panel bug?

$ xfce4-panel -V
xfce4-panel 4.14.4 (Xfce 4.14)

Copyright (c) 2004-2011
	The Xfce development team. All rights reserved.

Please report bugs to <http://bugzilla.xfce.org/>.

xfce4-panel upgrade (I don't understand why it didn't upgraded), clock is ok now
Weather plugin bug always alive

Offline

#14 2020-09-21 21:32:58

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Weather plugin no data or xfce panel bug?

tanis73 wrote:
$ xfce4-panel -V
xfce4-panel 4.14.4 (Xfce 4.14)

That's better smile

Weather plugin bug always alive

It would appear you have 4 choices:
1. Wait for the upgrade to hit sid repositories
2. Use the MX repository as Jerry has noted above
3. Build the weather plugin from source yourself
4. Use an alternative like the wttr script and the genmon plugin above


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#15 2020-09-22 17:17:38

Mellowbob
Member
Registered: 2011-10-16
Posts: 286

Re: Weather plugin no data or xfce panel bug?

ToZ wrote:
Mellowbob wrote:

However, the temp value in the panel app and the genmon version show different temps and forecasts.

This is because they are using 2 different sources of weather information. The weather plugin uses met.no and wttr supports a number of different formats, but the default is forecast.io.

References:
- https://github.com/chubin/wttr.in
- https://github.com/schachmat/wego

Odd behaviour is back. Yesterday it was displaying accurate weather ... today it's back to a %. Here's a screenshot ... oh, can't do that. Well, it has an icon followed by "76%" (no quotes).

I'll have to try the MX version I guess. Where does one get that?

Offline

#16 2020-09-22 17:24:45

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Weather plugin no data or xfce panel bug?

Mellowbob wrote:

Odd behaviour is back. Yesterday it was displaying accurate weather ... today it's back to a %. Here's a screenshot ... oh, can't do that. Well, it has an icon followed by "76%" (no quotes).

That is odd. Can you run the script manually in a terminal window like this:

bash -x /path/to/script > /tmp/w.log 2>&1

...and post back the contents of /tmp/w.log when done?

Which distro are you running?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#17 2020-09-22 23:53:02

Mellowbob
Member
Registered: 2011-10-16
Posts: 286

Re: Weather plugin no data or xfce panel bug?

I'm running Ubuntu 20.04.

Funny thing, I just restarted genmon and it's working again. I'll let it go for a day and see what happens.

Offline

#18 2020-09-23 01:38:17

Andrewclive
Member
Registered: 2019-04-18
Posts: 15

Re: Weather plugin no data or xfce panel bug?

Hello, I've just tried the script with the genmon panel plugin and have the same problem with it. As soon as I change the coordinates for my town (Nagasaki,Japan) the temperature is not shown and instead I get a number with a percentage (68%). The weather icon is okay. Hovering over the panel plugin the panel gives other erroneous data for example: Humidity = Cloudy, Moonphase gives the coordinates! With the original Toronto coordinates everything is fine.
Here is the log:

 + SITE=長崎市
+ LATITUDE=32.75
+ LONGITUDE=129.88333
+ CLICK_COMMAND='xfce4-terminal -H --geometry=126x41 -T Weather -x curl -s wttr.in/32.75,129.88333'
++ curl -s 'wttr.in/32.75,129.88333?format=%c\n%C\n%h\n%t\n%f\n%w\n%l\n%m\n%M\n%p\n%P\n%D\n%S\n%z\n%s\n%d\n'
+ OUT='⛅️ 
Partly cloudy
61%
+25°C
+27°C
↑9km/h
32.75,129.88333
?
6
0.0mm
1012hPa
05:44:23
06:09:28
12:12:51
18:15:39
18:40:41'
++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
++ awk '{print $1}'
+ WEATHERICON=⛅️
++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
++ awk '{print $2}'
+ WEATHERCONDITION=Partly
++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
++ awk '{print $3}'
+ HUMIDITY=cloudy
++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
++ sed -e 's/^-0/0/g'
++ sed -e s/+//g
++ awk '{print $4}'
+ TEMPERATURE=61%
++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
++ sed -e 's/^-0/0/g'
++ sed -e s/+//g
++ awk '{print $5}'
+ FEELSLIKE=25°C
++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
++ awk '{print $6}'
+ WIND=+27°C
++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
++ awk '{print $7}'
+ LOCATION=↑9km/h
++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
++ awk '{print $8}'
+ MOONPHASE=32.75,129.88333
++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
++ awk '{print $9}'
+ MOONDAY=?
++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
++ awk '{print $10}'
+ PRECIPITATION=6
++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
++ awk '{print $11}'
+ PRESSURE=0.0mm
+++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
+++ awk '{print $12}'
++ toDate 1012hPa
+++ echo 1012hPa
+++ awk -F: '{print $1}'
++ HOUR=1012hPa
+++ echo 1012hPa
+++ awk -F: '{print $2}'
++ MINUTE=
++ case $HOUR in
++ echo '1012hPa: '
+ DAWN='1012hPa: '
+++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
+++ awk '{print $13}'
++ toDate 05:44:23
+++ echo 05:44:23
+++ awk -F: '{print $1}'
++ HOUR=05
+++ echo 05:44:23
+++ awk -F: '{print $2}'
++ MINUTE=44
++ case $HOUR in
++ HOUR=5
++ AMPM=am
++ echo '5:44 am'
+ SUNRISE='5:44 am'
+++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
+++ awk '{print $14}'
++ toDate 06:09:28
+++ echo 06:09:28
+++ awk -F: '{print $1}'
++ HOUR=06
+++ echo 06:09:28
+++ awk -F: '{print $2}'
++ MINUTE=09
++ case $HOUR in
++ HOUR=6
++ AMPM=am
++ echo '6:09 am'
+ ZENITH='6:09 am'
+++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
+++ awk '{print $15}'
++ toDate 12:12:51
+++ echo 12:12:51
+++ awk -F: '{print $1}'
++ HOUR=12
+++ echo 12:12:51
+++ awk -F: '{print $2}'
++ MINUTE=12
++ case $HOUR in
++ HOUR=12
++ AMPM=am
++ echo '12:12 am'
+ SUNSET='12:12 am'
+++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
+++ awk '{print $16}'
++ toDate 18:15:39
+++ echo 18:15:39
+++ awk -F: '{print $1}'
++ HOUR=18
+++ echo 18:15:39
+++ awk -F: '{print $2}'
++ MINUTE=15
++ case $HOUR in
++ HOUR=6
++ AMPM=pm
++ echo '6:15 pm'
+ DUSK='6:15 pm'
++ echo ⛅️ Partly cloudy 61% +25°C +27°C ↑9km/h 32.75,129.88333 ? 6 0.0mm 1012hPa 05:44:23 06:09:28 12:12:51 18:15:39 18:40:41
++ awk '{print $17}'
+ PROBPRECIPITATION=18:40:41
+ echo WEATHERICON=⛅️
WEATHERICON=⛅️
+ echo WEATHERCONDITION=Partly
WEATHERCONDITION=Partly
+ echo HUMIDITY=cloudy
HUMIDITY=cloudy
+ echo TEMPERATURE=61%
TEMPERATURE=61%
+ echo FEELSLIKE=25°C
FEELSLIKE=25°C
+ echo WIND=+27°C
WIND=+27°C
+ echo LOCATION=↑9km/h
LOCATION=↑9km/h
+ echo MOONPHASE=32.75,129.88333
MOONPHASE=32.75,129.88333
+ echo MOONDAY=?
MOONDAY=?
+ echo PRECIPITATION=6
PRECIPITATION=6
+ echo PRESSURE=0.0mm
PRESSURE=0.0mm
+ echo 'DAWN=1012hPa: '
DAWN=1012hPa: 
+ echo 'SUNRISE=5:44 am'
SUNRISE=5:44 am
+ echo 'ZENITH=6:09 am'
ZENITH=6:09 am
+ echo 'SUNSET=12:12 am'
SUNSET=12:12 am
+ echo 'DUSK=6:15 pm'
DUSK=6:15 pm
+ echo '<txt><span size='\''x-large'\''>⛅️</span><span rise='\''1500'\''> 61%</span></txt>'
<txt><span size='x-large'>⛅️</span><span rise='1500'> 61%</span></txt>
+ echo '<txtclick>xfce4-terminal -H --geometry=126x41 -T Weather -x curl -s wttr.in/32.75,129.88333</txtclick>'
<txtclick>xfce4-terminal -H --geometry=126x41 -T Weather -x curl -s wttr.in/32.75,129.88333</txtclick>
++ date
+ echo '<tool><span font_desc='\''Bold 16'\''>⛅️</span>  <b><big>長崎市</big></b>
61% <small>and</small> Partly
<small>
Feels like:       25°C
Humidity:       cloudy
Wind:             +27°C
Precipitation: 6
Pressure:       0.0mm

Rise/Set:        5:44 am / 12:12 am

Moon:            32.75,129.88333
</small>
<span size='\''x-small'\''>Wed 23 Sep 10:34:30 JST 2020</span></tool>'
<tool><span font_desc='Bold 16'>⛅️</span>  <b><big>長崎市</big></b>
61% <small>and</small> Partly
<small>
Feels like:       25°C
Humidity:       cloudy
Wind:             +27°C
Precipitation: 6
Pressure:       0.0mm

Rise/Set:        5:44 am / 12:12 am

Moon:            32.75,129.88333
</small>
<span size='x-small'>Wed 23 Sep 10:34:30 JST 2020</span></tool>
+ exit 0 

Thanks for your help.

Offline

#19 2020-09-23 02:23:44

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Weather plugin no data or xfce panel bug?

Thanks for the output. I see whats happening. The script is getting thrown off if the weather condition contains more than one word (e.g. "Partly Cloudy"). I've adjusted the script up in post #2. Can you give that another try?

Edit: Just changed it one more time.

Last edited by ToZ (2020-09-23 02:29:13)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#20 2020-09-23 02:40:49

Andrewclive
Member
Registered: 2019-04-18
Posts: 15

Re: Weather plugin no data or xfce panel bug?

ToZ,
The script is working nicely now. It's just what I want.
Thank you very much for your help.

Offline

#21 2020-09-24 00:06:57

Mellowbob
Member
Registered: 2011-10-16
Posts: 286

Re: Weather plugin no data or xfce panel bug?

I think it's working here as well. Interesting, though, how different the forecasts are between this service and weather canada. Guess that is a feature smile

Offline

#22 2020-09-24 19:42:49

trilobite
Member
From: NE Sask, Canada at present
Registered: 2020-09-24
Posts: 2

Re: Weather plugin no data or xfce panel bug?

Great script @ToZ ! 
Solved my problem.

Offline

#23 2020-09-24 22:53:28

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Weather plugin no data or xfce panel bug?

trilobite wrote:

Great script @ToZ ! 
Solved my problem.

Thanks. And welcome to the forum fellow Canadian.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#24 2020-12-24 14:27:20

linb-xfce
Member
From: Midwest, United States
Registered: 2020-12-24
Posts: 2

Re: Weather plugin no data or xfce panel bug?

I used the above script in my genmon plugin and it works as described. Much obliged to the developer/author.

Given I've only lived in the United States and am not quite up to speed with the metric system as my daily reference point, does anyone have tips for me to change the script to output temperature as Fahrenheit instead of Celsius and wind speed as MPH (miles per hour) instead of KM (kilometres per hour)?


Newbie Linux user. xbuntu w/ xfce4

Offline

#25 2020-12-24 15:09:15

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Weather plugin no data or xfce panel bug?

Hello and welcome.

linb-xfce wrote:

I used the above script in my genmon plugin and it works as described. Much obliged to the developer/author.

Given I've only lived in the United States and am not quite up to speed with the metric system as my daily reference point, does anyone have tips for me to change the script to output temperature as Fahrenheit instead of Celsius and wind speed as MPH (miles per hour) instead of KM (kilometres per hour)?

According to the wttr documentation calls made from the USA will be use the USCS format. Odd that it isn't happening for you.

You can, however, force the output to USCS format by adding "&u" to the end of the call:

OUT=$(curl -s wttr.in/$LATITUDE,$LONGITUDE?format="%c\n%h\n%t\n%f\n%w\n%l\n%m\n%M\n%p\n%P\n%D\n%S\n%z\n%s\n%d\n%C
\n&u")

Edit:
You also need to change the click command (add "?u" to the end):

CLICK_COMMAND="xfce4-terminal -H --geometry=126x41 -T "Weather" -x curl -s wttr.in/$LATITUDE,$LONGITUDE?u"

Last edited by ToZ (2020-12-24 16:57:49)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.015 seconds, 9 queries executed - Memory usage: 706.82 KiB (Peak: 755.66 KiB) ]