Want a quick way to check the weather without opening a browser or installing any apps? If you're a Linux user who lives in the terminal, wttr.in is a clever little tool that gives you weather forecasts directly from the command line.
It's lightweight, works with just curl
or wget
, and supports a variety of custom formats. Whether you're building a Conky weather widget or just want to stay updated before heading out, wttr.in is a reliable solution.
Basic Usage
To check your local weather, simply open a terminal and type:
curl wttr.in
You’ll get a nice text-based weather forecast, complete with temperature, wind, and condition icons. If you want to check a specific location, just add the city name:
curl wttr.in/london
Customize the Output
wttr.in allows you to tweak the format to make it more minimal or more detailed. For example:
curl wttr.in/yogyakarta?format=3
That will return something like: Yogyakarta: 🌤 +30°C
Here's a list of some useful format codes:
%l
– Location%c
– Weather condition%t
– Temperature%w
– Wind
Example combining all of them:
curl 'wttr.in/?format=%l:+%c+%t+%w'
Output: YourCity: ☀️ +31°C ↘ 10 km/h
Use in Scripts and Conky
Because wttr.in works with plain text, it’s easy to integrate into your Conky widgets or bash scripts. You can pipe the output into variables, log files, or even use it with jq
for more complex setups.
curl -s 'wttr.in/yogyakarta?format=3' > ~/.cache/weather.txt
Then read it in Conky using cat ~/.cache/weather.txt
Bonus Tip
You can also use wttr.in in a web browser! Just visit:
https://wttr.in
Or for specific cities: https://wttr.in/bandung
For more detailed documentation and advanced usage examples — including localization, metrics, terminal options, and integration with other tools — visit the official project page on GitHub:
https://github.com/chubin/wttr.in
Final Thoughts
wttr.in is a brilliant example of how powerful and elegant the command line can be. Whether you’re scripting your own widgets or just want quick weather info, this tool deserves a place in your daily Linux workflow.
No installation, no API keys — just curl and go.
0 Comments