YSK How to get a weather report in your terminal

cross-posted from: https://gekinzuku.com/post/394282

Lately I've been obsessed with moving everything that people typically use as widgets into my bashrc. Today I discovered wttr.in, which is an open source project on Github at https://github.com/chubin/wttr.in

Usage is almost trivial. To get weather in your terminal, simply curl the URL with your city after the forward slash. If you live in New York City, use
curl 'https://wttr.in/New%20York'

Now, if that's too much bloat to have covering your precious terminal real estate, instead use
curl 'https://wttr.in/New%20York'?0?A?u which will truncate the curl to only today's weather.

175 points · 17 comments · view on lemmy.world

17 Comments

mvirts@lemmy.world · 13 pts · 2y (3 replies)

Weird, I usually just get weather report on my speakers

DickFiasco@lemm.ee · 5 pts · 2y

RIP Jaco

steal_your_face@lemmy.ml · 4 pts · 2y

Love a good weather report suite

graham1@gekinzuku.com · 4 pts · 2y

Heavy Weather

Juujian@lemmy.world · 10 pts · 2y (1 reply)

Can you get more than three days?

graham1@gekinzuku.com · 5 pts · 2y

I think no. It appears to be a limitation of the underlying WorldWeatherOnline API.
See https://github.com/chubin/wttr.in#get-a-worldweatheronline-key-and-configure-wego
and https://github.com/chubin/wttr.in/issues/682

fernandu00@lemmy.ml · 8 pts · 2y (2 replies)

O stepped into this a couples days ago looking for a weather info to waybar and found this python script with wttr ...with a couple tweaks and some documentation reading I got it to work really easily in Portuguese

graham1@gekinzuku.com · 1 pts · 2y (1 reply)

I like that I can change to https://pt.wttr.in/ and get the Portuguese site

fernandu00@lemmy.ml · 2 pts · 2y

Saw that just after tweaking the script to get the pt-br entry of the json object so I didn't change to pt website

mlg@lemmy.world · 6 pts · 2y (1 reply)

You can also use this in conjuction with conky to get text weather on your desktop

graham1@gekinzuku.com · 4 pts · 2y

To follow up on that, here are the official conky directions: https://github.com/chubin/wttr.in#conky

ono@lemmy.ca · 4 pts · 2y

There is also the weather command. Text only, but more detail and more days ahead.

TheBlue22@lemmy.world · 3 pts · 2y (1 reply)

Partly cloudy looks like a bunny lol

graham1@gekinzuku.com · 2 pts · 2y

I can't unsee it now

grue@lemmy.world · 3 pts · 2y (1 reply)

Apparently, this needs the terminal to be at least 125 characters wide to display correctly. My terminal is typically narrower than that (110 by default in uncustomized Konsole, or 116 when I snap it to half my monitor width).

Is there a way to get it formatted for the traditional VT100 80-character width, or at least ≤110?

graham1@gekinzuku.com · 2 pts · 2y

Sorry, I forgot to get back to this. It looks like it's possible to get something that fits better with the ?2n option. See https://github.com/chubin/wttr.in/issues/151

velitedi@lemmy.world · 3 pts · 2y

This is one use case where I actually much prefer windows