ASCII weather app for the terminal
Days of Thunder

Other applications have found less complex ways of showing the weather in a terminal, but none is as attractive as Wego.
People love to check out the weather forecast, but some users prefer to avoid the many web-based services, where you first need to search for the forecast amid all the advertising or switch to the desktop and face the weather through a Plasmoid or Conky widget. Users who always have a terminal open will appreciate the attractive Wego option for presenting the weather in a command-line window.
The Wego weather app [1], written in the Go programming language designed by Google, uses ASCII art to display the weather forecast for the next one to five days. In this case, using the terminal does not mean poor visuals or a lack of functionality. In this article, I'll take a closer look at Wego and briefly investigate the alternatives.
Weather Forecast
Wego delivers information on the temperature range, wind speed and direction, visibility, and the likelihood and amount of precipitation (Figure 1) for up to five days in advance. The information is SSL-encrypted for transmission to the local computer.

The requirements for installation are quickly met. If you've not done so already, you need to set up Git and a Go environment and also register on the weather website at forecast.io. You can pick up a free API key from the site that lets Wego retrieve the raw weather data. The terminal you are using must support 256 colors and UTF-8. Most terminals meet these requirements out of the box, although you may have to adapt the settings by right-clicking on the open terminal in the profile. You can experiment with the font type and size until the Wego output is to your liking.
Preparations
First, install Go and Git for your distribution. On Debian and its derivatives, you can do this with the command from the first line of Listing 1. On Fedora, the corresponding command is, for example:
dnf install golang git
Listing 1
Go Environment Setup
01 $ sudo apt-get update && sudo apt-get install golang git 02 $ echo 'export GOPATH="$HOME/wego"' >> ~/.bashrc; source ~/.bashrc 03 $ mkdir ~/wego 04 $ go get github.com/schachmat/wego 05 $ echo 'export PATH="$PATH:$GOPATH/bin"' >> ~/.bashrc; source ~/.bashrc
Next, you need to set up an environment for Go. To integrate a Go environment, you first need to set an environmental variable for Go. The command from the second line of Listing 1 writes the GOPATH
to the .bashrc
file, the shell configuration file.
Now check Wego out of GitHub – that is, download the code to your computer. To do this, create the directory specified in the environmental variable and pick up the code from GitHub (Listing 1, lines 3 and 4). You could start Wego now, by changing to the directory with the executable and typing ./wego
. However, to make the call more convenient, and to be able to call Wego as a user from anywhere in the terminal, you need to set a second environmental variable that adds /bin
to your GOPATH
(Listing 1, line 5).
After you add /bin
, you can launch Wego in a terminal simply by typing wego
. However, you will still not see the weather displayed when you first start – the program needs you to point it to the data source. Instead, you just see two error messages (Listing 2). The first line is simply telling you that the program creates the hidden configuration file, ~/.wegorc
, when first launched. You will need to edit this file now.
Listing 2
Error Messages
$ wego No config file found. Creating /home/User/.wegorc ... No API key specified. Setup instructions are in the README.
API Key
The second line refers to the API key, which you need to get to see the weather (Figure 2). To get the API key, surf to the website on https://developer.forecast.io/register. After you have registered, your free API key will be presented to you. Then, copy the APIKey
to the hidden .wegorc
file in your home directory (Listing 3).
Listing 3
Specify Location
{ "APIKey": "MyAPIkey", "City": "Kansas City", "Numdays": 3, "Imperial": false, "Lang": "en" }

You can specify a location (City
) as well as the number of forecast days (Numdays
) you want to see. If you want to specify values in imperial measures, change the setting for the Imperial
keyword from false
to true
.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Direct Download
Read full article as PDF:
Price $2.95
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Find SysAdmin Jobs
News
-
Kubuntu Focus Announces XE Gen 2 Linux Laptop
Another Kubuntu-based laptop has arrived to be your next ultra-portable powerhouse with a Linux heart.
-
MNT Seeks Financial Backing for New Seven-Inch Linux Laptop
MNT Pocket Reform is a tiny laptop that is modular, upgradable, recyclable, reusable, and ships with Debian Linux.
-
Ubuntu Flatpak Remix Adds Flatpak Support Preinstalled
If you're looking for a version of Ubuntu that includes Flatpak support out of the box, there's one clear option.
-
Gnome 44 Release Candidate Now Available
The Gnome 44 release candidate has officially arrived and adds a few changes into the mix.
-
Flathub Vying to Become the Standard Linux App Store
If the Flathub team has any say in the matter, their product will become the default tool for installing Linux apps in 2023.
-
Debian 12 to Ship with KDE Plasma 5.27
The Debian development team has shifted to the latest version of KDE for their testing branch.
-
Planet Computers Launches ARM-based Linux Desktop PCs
The firm that originally released a line of mobile keyboards has taken a different direction and has developed a new line of out-of-the-box mini Linux desktop computers.
-
Ubuntu No Longer Shipping with Flatpak
In a move that probably won’t come as a shock to many, Ubuntu and all of its official spins will no longer ship with Flatpak installed.
-
openSUSE Leap 15.5 Beta Now Available
The final version of the Leap 15 series of openSUSE is available for beta testing and offers only new software versions.
-
Linux Kernel 6.2 Released with New Hardware Support
Find out what's new in the most recent release from Linus Torvalds and the Linux kernel team.