For Linux desktop users, there are many ways to access weather forecasts, e.g., using standalone weather apps, desktop widgets, or panel applets. If your work environment is terminal-based, there are also several ways to access weather forecasts from the command line.
Among them is wego, a cute little weather app for the terminal. Using an ncurses-based fancy interface, this command-line app allows you to see current weather conditions and forecasts at a glance. It retrieves the weather forecasts for the next 5 days via a weather forecast API.
Install Wego on Linux
Installation of wego is pretty simple. wego is written in Go language, thus the first step is to install Go language. After installing Go, proceed to install wego as follows.
The wego tool will be installed under $GOPATH/bin. So add $GOPATH/bin to your $PATH variable.
$ source ~/.bashrc
Now go ahead and invoke wego from the command line.
The first time you run wego, it will generate a config file (~/.wegorc), where you need to specify a weather API key.
You can obtain a free API key from worldweatheronline.com. Free sign-up is quick and easy. You only need a valid email address.
Your .wegorc will look like the following.
Other than API key, you can specify in ~/.wegorc your preferred location, use of metric/imperial units, and language.
Note that the weather API is rate-limited; 5 queries per second, and 250 queries per day.
When you invoke wego command again, you will see the latest weather forecast (of your preferred location), shown as follows.
The displayed weather information includes: (1) temperature, (2) wind direction and speed, (3) viewing distance, and (4) precipitation amount and probability.
By default, it will show 3-day weather forecast. To change this behavior, you can supply the number of days (upto five) as an argument. For example, to see 5-day forecast:
If you want to check the weather of any other location, you can specify the city name.
1. You encounter the following error while running wego.
user: Current not implemented on linux/amd64
This error can happen when you run wego on a platform which is not supported by the native Go compiler gc (e.g., Fedora). In that case, you can compile the program using gccgo, a compiler-frontend for Go language. This can be done as follows.
$ go get -compiler=gccgo github.com/schachmat/wego
Subscribe to Ask Xmodulo
Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!