Xfce Forum

Sub domains
 

You are not logged in.

#26 2020-12-25 12:28:06

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

Re: Weather plugin no data or xfce panel bug?

ToZ wrote:

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"

Thank you for the prompt reply. I will use your snippets for my case.

It turns out, I was getting a Celsius display because my VPN was using a European-based server with that location as the geographic IP. My VPN rotates the servers, apparently -- most times it uses a U.S.-based server. Anyway, if I toggle the VPN to off, the plugin changes to Fahrenheit.

So, your solution will be helpful for me if I want to force it to use U.S. IP. Thanks again for your help and solution.

Last edited by linb-xfce (2020-12-25 12:31:23)


Newbie Linux user. xbuntu w/ xfce4

Offline

#27 2021-03-13 15:25:47

jakfish
Member
Registered: 2019-12-23
Posts: 55

Re: Weather plugin no data or xfce panel bug?

This is a wonderful weather script, thank you so much for it.

One small question--because the text readout is centered to the side of the icon, the font size must be reduced; if you use the same font size as other genmons, clock, etc, the weather text will spill out past the bottom of the panel.

Is it possible to move the weather text to the top of the panel rather than remain centered to its icon?

Again, thanks for a great workaround. I was using the MX weather applet but that has stopped working as well.

Jake

Offline

#28 2021-03-13 15:36:27

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

Re: Weather plugin no data or xfce panel bug?

jakfish wrote:

This is a wonderful weather script, thank you so much for it.

One small question--because the text readout is centered to the side of the icon, the font size must be reduced; if you use the same font size as other genmons, clock, etc, the weather text will spill out past the bottom of the panel.

Is it possible to move the weather text to the top of the panel rather than remain centered to its icon?

Again, thanks for a great workaround. I was using the MX weather applet but that has stopped working as well.

Jake

Line 83 of the original script has a "<span rise='0'>" option (pango formatting). Try increasing that value in minimum increments of 1000 and the text will move up in the container. A value of 10000 and you will see a noticeable change. If that doesn't work, can you post back an image of the issue?


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

#29 2021-03-13 16:00:30

jakfish
Member
Registered: 2019-12-23
Posts: 55

Re: Weather plugin no data or xfce panel bug?

Many thanks for both the fast response and the perfect edit. 5000 appears to be the sweet spot for my panel's specs. Weather text now in perfect alignment with all other readouts, very welcome since I use genmon for battery, cpu temp, and uptime.

What a relief to have this script in tow as weather plugins appear to come and go, and mostly go.

Jake

Offline

Registered users online in this topic: 0, guests: 2
[Bot] ClaudeBot (2)

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.008 seconds, 8 queries executed - Memory usage: 534.94 KiB (Peak: 535.78 KiB) ]