Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coordination showing when location set to false Bug #267

Open
Edvid opened this issue May 28, 2024 · 1 comment
Open

Coordination showing when location set to false Bug #267

Edvid opened this issue May 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Edvid
Copy link
Contributor

Edvid commented May 28, 2024

Describe the bug

Sometimes, the weather part of the plugin displays my coordinates, despite having set -g @dracula-show-location falsse

To Reproduce

Steps to reproduce the behavior:

  1. use set -g @dracula-plugins "hostname window cpu-usage gpu-usage ram-usage time weather" or anything else using weather
  2. set -g @dracula-show-location false
  3. Go throughout your day using tmux (It is rare. I have seen it happen three times, and I've been using tmux for half a year)
  4. See behaviour similar to mine

Expected behavior

For this to never ever happen

Screenshots

Excuse the weird blur.. I just didn't want to doxx myself
coords

System

  • OS: Arch Linux
  • Tmux Version: 3.4
@Edvid Edvid added the bug Something isn't working label May 28, 2024
@Edvid
Copy link
Contributor Author

Edvid commented May 28, 2024

Done a little digging. You make use of an API at wttr.in with curl.
The following line dictates how you display temperature in the (sub)plugin.
temperature=$(echo $weather_information | rev | cut -d ' ' -f 1 | rev) # +31°C, -3°F, etc
This takes the last word of the stdout from the fetch_weather_information() which in turn is the stdout of a curl call to wttr.in with format parameters %C and %t
The line is: curl -sL wttr.in/${fixedlocation// /%20}\?format="%C+%t$display_weather". 26th in weather.sh

Sadly, sometimes the output from this API is:
Unknown location; please try ~ with being replaced with coordinates

$ curl -SL wttr.in/~Eifal+Tuwer\?format="%C+%t&u"
Unknown location; please try ~not found

$ curl -SL wttr.in/~Eifel+Tower\?format="%C+%t&u"
Unknown location; please try ~49.9456277,6.5562824

$ curl -SL wttr.in/~49.9456277,6.5562824\?format="%C+%t&u"
Unknown location; please try ~49.9457915,6.5566064

$ curl -SL wttr.in/~49.9457915,6.5566064\?format="%C+%t&u"
Unknown location; please try ~49.9457915,6.5566064

This seems to not be an issue with how this plugin parses the input coordinates to the API. The fact that it breaks sometimes seemingly out of nowhere, and the following returned text from curl if we parse no format parameters gives me the impression that this is just their service being down sometimes.

the returned text from API without params:

Sorry, we are running out of queries to the weather service at the moment.
Here is the weather report for the default city (just to show you what it looks like).
We will get new queries as soon as possible.
You can follow https://twitter.com/igor_chubin for the updates.
======================================================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant