this post was submitted on 10 Sep 2023
172 points (95.7% liked)

Linux

8095 readers
31 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 1 year ago
MODERATORS
 

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.

top 17 comments
sorted by: hot top controversial new old
[–] [email protected] 12 points 1 year ago (3 children)

Weird, I usually just get weather report on my speakers

[–] [email protected] 4 points 1 year ago

Love a good weather report suite

[–] [email protected] 4 points 1 year ago
[–] [email protected] 3 points 1 year ago

Heavy Weather

[–] [email protected] 10 points 1 year ago (1 children)

Can you get more than three days?

[–] [email protected] 5 points 1 year ago
[–] [email protected] 8 points 1 year ago (1 children)

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

[–] [email protected] 1 points 1 year ago (1 children)

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

[–] [email protected] 2 points 1 year ago

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

[–] [email protected] 6 points 1 year ago (1 children)

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

[–] [email protected] 4 points 1 year ago

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

[–] [email protected] 4 points 1 year ago

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

[–] [email protected] 3 points 1 year ago (1 children)

Partly cloudy looks like a bunny lol

[–] [email protected] 2 points 1 year ago

I can't unsee it now

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago) (1 children)

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?

[–] [email protected] 2 points 1 year ago

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

[–] [email protected] 3 points 1 year ago

This is one use case where I actually much prefer windows