News for hackers. Stuff that matters.
Re:`curl wttr.in`: Weather in your terminal by trinovantes on Saturday May 14, 2022 @09:14PM (#31384348)
If only there's a $PS1 version
Re:`curl wttr.in`: Weather in your terminal by mrweasel on Sunday May 15, 2022 @02:44AM (#31385719)
It might just be me, but I never saw the usefulness in widgets that shows the current weather, at your current location. I mean can’t you just look out the window?

Stuffing a three days weather report into $PS1 might be to much information for a prompt.

Re:`curl wttr.in`: Weather in your terminal by jona-f on Sunday May 15, 2022 @06:42AM (#31386687)
I have to get up and walk to the window, so looking it up in the terminal is much faster. But I agree that it feels somewhat detached from nature. Also the thermometer at the window varies a lot with direct sunlight or wind, so i find these weather services give a better estimate to what i should be wearing when i go outside.
Re:`curl wttr.in`: Weather in your terminal by teddyh on Sunday May 15, 2022 @06:50AM (#31386711)
I’m reminded of the old discussion of which clock program for X11 consumed the least resources and screen size. It concluded with something like: “Of course, the clock which consumes no resources, and does not take any screen space, is the clock which hangs on your wall.”.
Re:`curl wttr.in`: Weather in your terminal by queuebert on Saturday May 14, 2022 @09:20PM (#31384389)
That would be cool, but how would you condense the information enough that it's both useful and doesn't take up 2/3 of a line?
Re:`curl wttr.in`: Weather in your terminal by derwiki on Saturday May 14, 2022 @09:56PM (#31384577)
I might be a heathen, but my PS1 is as long as it wants to be, and ends with \n$
Re:`curl wttr.in`: Weather in your terminal by Shared404 on Saturday May 14, 2022 @10:20PM (#31384698)
I feel like I should hate this...

But I don't. I may steal this idea later, than there would be a whole 2 of us!

Re:`curl wttr.in`: Weather in your terminal by queuebert on Sunday May 15, 2022 @11:55AM (#31388340)
That's a great old-school idea. I used to run it that way but forgot.

I have also started adding a time stamp to the second, so that when I run long commands and come back later in a tmux session I can see when it finished.

Re:`curl wttr.in`: Weather in your terminal by enriquto on Sunday May 15, 2022 @09:03AM (#31387308)
> how would you condense the information enough that it's both useful and doesn't take up 2/3 of a line?

There's a method that takes 0 space: just change the color of the prompt symbol depending on the weather status (sunny, cloudy, raining, snowing).

Re:`curl wttr.in`: Weather in your terminal by LeonB on Saturday May 14, 2022 @09:49PM (#31384544)
It’s provides different formats, I was using this one in the past from Powershell

invoke-restmethod wttr.in/?format=4

…and I think it was quite compact

Re:`curl wttr.in`: Weather in your terminal by CrispinS on Saturday May 14, 2022 @09:28PM (#31384436)
Emojis? For the current weather, a single emoji could convey quite a lot; e.g. a snowflake for sub-60 weather (I have a low tolerance for cold), a sun for 60-80, fire emoji for 80+...

Now, I don't know if anyone truly needs the weather in their terminal prompt, but it is doable.

Re:`curl wttr.in`: Weather in your terminal by dredmorbius on Sunday May 15, 2022 @05:35AM (#31386410)
Microcharts or sparklines are another option. I've seen a few implementations along these lines for shell prompts / shell use.

This might be useful for temperature, humidity, wind, preciptitation, and similar measures, either as quantities or timelines.

https://en.wikipedia.org/wiki/Sparkline

https://github.com/deeplook/sparklines

Similar:

https://www.linux-magazine.com/Issues/2016/183/Calc-Conditio...

Re:`curl wttr.in`: Weather in your terminal by behnamoh on Saturday May 14, 2022 @11:58PM (#31385150)
perhaps the RPROMPT would be better. i usually use it to show time %T.
Re:`curl wttr.in`: Weather in your terminal by Kim_Bruning on Sunday May 15, 2022 @02:48AM (#31385733)
curl 'wttr.in/?format=%c'

see the readme here for all options:

https://github.com/chubin/wttr.in

Re:`curl wttr.in`: Weather in your terminal by behnamoh on Saturday May 14, 2022 @11:57PM (#31385141)
i know you’re referring to the shell prompt, but it reminded me that PowerShell file extension is also *.ps1 (which I find strange as I’m not used to seeing numbers in file extensions).

didn’t this really come up when MS was designing PowerShell?

Re:`curl wttr.in`: Weather in your terminal by smegsicle on Sunday May 15, 2022 @01:39PM (#31389301)
i think they count the namespace pollution as free advertising