How to Display the Weather Forecast on Linux

Weather

Weather information is crucial for planning and scheduling your daily tasks. In Linux desktops, there are variety of options to get that info. This tutorial walks you through some of the best available solutions.

Desktop Apps

These are traditional desktop apps that display weather information. They have little to no integration with the desktop shell.

1. Gnome Weather

As the name suggests, Gnome weather was created by Gnome developers. It’s included in the official repository of all the major Linux distributions. If you are using some other distribution, you can download the source code from the official Gnome repository.

This is a GTK-based app that integrates very well with the Gnome desktop environment. With location services enabled, Gnome weather will auto-detect your location and display the weather. You can also select a location manually.

Weather 1

If you’re on Debian or Ubuntu-based distributions, you can install the app by using the following:

sudo apt update
sudo apt install gnome-weather

For Fedora or RHEL-based distributions, run:

sudo dnf install gnome-weather

You can also install Gnome weather using flatpak and snap packages. These are distro agnostic packages and work everywhere. To install via flatpak:

flatpak install flathub org.gnome.Weather

To install using snap:

sudo snap install gnome-weather

2. Meteo

Meteo is a weather forecasting app made with Vala and GTK. It uses the OpenWeatherMap API to display weather information and weather forecasting.

Weather 2

You can see current temperature, wind speed and direction, sunrise and sunset using this application. Meteo also comes with up to five days of weather forecasting and support for metric, imperial and British units.

A unique feature of Meteo is that it can display maps along with the weather conditions.

Weather 3

If you are using Ubuntu and its derivatives, you can use the official PPA (personal package archive) provided by the Meteo team to install the software.

sudo add-apt-repository ppa:bitseater/ppa
sudo apt update
sudo apt install com.gitlab.bitseater.meteo

For Debian, you can download the .deb file from its official repository. After downloading the package, install the .deb file using the dpkg command.

sudo dpkg -i packagename.deb

Meteo is available in the official Fedora repository. You can install it by running this command:

sudo dnf install meteo

You can also use flatpak to install Meteo in any distribution you would like.

flatpak install --from https://flathub.org/repo/appstream/com.gitlab.bitseater.meteo.flatpakref

3. Coffee

Coffee is a very modern-looking GTK weather application for your Linux desktop. Besides weather, this application also lets you choose your favorite news websites from a list of 44 options and displays news in a scrolling widget.

Coffee relies on the Dark Sky API to display weather information in a five-day format. If your geolocation is active, this application can automatically pin your location and display local weather.

Weather 4

If you are using an Ubuntu derivative, Coffee creators provide you with a PPA to install the application.

sudo add-apt-repository ppa:coffee-team/coffee
sudo apt update
sudo apt install com.github.nick92.coffee

On Arch Linux, you can install Coffee using yaourt package manager.

sudo yaourt coffee-git

On other distributions, you’ll have to build Coffee from source. Before building, install the following dependencies.

sudo apt install libglib2.0-dev libgtk-3-dev libjson-glib-dev libsoup2.4-dev libgee-0.8-dev libgeocode-glib-dev libgeoclue-2 dev meson valac

If you are using some other package manager like dnf, you can search Google for the name of those dependencies according to your package manager.

After installing all of the required dependencies, you can build the Coffee package.

mkdir build
meson build --prefix=/usr
ninja

When the above command executes successfully, you can finally install the application.

sudo ninja install ./src/com.github.nick92.coffee

Some other alternatives to desktop weather apps are:

Shell Extensions

Shell extensions are software integrated with your shell. There are many shells in the Linux world, but here we are primarily discussing Gnome shell extensions, but also taking a look at KDE and XFCE.

1. Open Weather

Open Weather is a Gnome shell extension that displays the latest weather data and weather forecast. As the name suggests, this application uses OpenWeatherMap to display weather information and can display up to eight days of weather forecasting.

Weather 5

You can install Open Weather using the extensions.gnome.org website. After installation, restart your Gnome session and activate the extension via your extension application.

If you want to install it using your package manager, you can definitely do so. This extension is available for all the major distributions.

For Debian and Ubuntu derivatives, run the following command:

sudo apt update
sudo apt install gnome-shell-extension-weather

For Fedora or other RHEL distribution, you can install this software using dnf.

sudo dnf install gnome-shell-extension-openweather

This extension is also available in Arch user repository. You can install it using yaourt package manager.

yaourt -S gnome-shell-extension-openweather-git

To use this extension, you have to get your own API key from OpenWeatherMap or Dark Sky. The free plan is enough for the extension.

2. My Weather Indicator

My Weather Indicator is specially designed for Gnome desktops but supports the KDE Plasma, MATE, and XFCE desktop environments. The extension is packed with many features. In addition to providing current weather information, it can show you the weather forecast, pressure, local area maps, moon calendar etc.

Linux Weather Forecast My Weather Indicator

Besides being feature rich, this extension comes with many customization options. You can select up to two cities to get simultaneous updates. The interface also provides you with the option to choose from different weather data providers.

To install the software in Ubuntu-based distributions, run these commands:

sudo add-apt-repository ppa:atareao/atareao
sudo apt update
sudo apt install my-weather-indicator

If you don’t want to install from the Ubuntu PPA, make sure to install the following dependency to run My Weather Indicator in your system.

gir1.2-gtk-3.0
gir1.2-glib-2.0
gir1.2-gdkpixbuf-2.0
gir1.2-appindicator3-0.1
gir1.2-notify-0.7
gir1.2-webkit2-4.0
gir1.2-geocodeglib-1.0
gir1.2-osmgpsmap-1.0
python3-tz
python3-tzlocal
python3-cairo
python3-lxml
python3-dateutil
python3-requests
python3-requests-oauthlib

Some other alternatives of weather extensions are:

Command Line Tools

Command line tools run on the terminal and have no GUI. Nonetheless, they can prove quite handy if you’re looking to get the job done quickly.

1. Wttr.in

wttr.in is a CLI tool that is using cURL to display weather in your terminal application. This is the most feature-rich terminal weather application you can find and works on every platform. To run this application, you should install cURL on your device.

Note: you can also test wttr.in in your browser if you would like. The tool automatically detects your geolocation and shows the weather information accordingly.

Weather 6

To to do so in an Ubuntu-based distribution:

sudo apt update
sudo apt install curl

For a Fedora-based distribution:

sudo dnf install curl

To get the weather information for specific cities, you have to construct your URL as shown below.

curl wttr.in/London
curl wttr.in/Moscow
curl wttr.in/Salt+Lake+City

You can also query weather information by adding the three-letter code of your nearest airport.

curl wttr.in/muc
curl wttr.in/ham

Version 2 of the wttr.in CLI comes with additional weather information with astronomical data and some really cool ASCII art. Version 3 of the tool also supports maps and images.

2. Ansiweather

Ansiweather is a powerful yet very simple CLI tool that can display the weather in your terminal. It support ANSI colors and Unicode characters. To run this CLI tool, you’ll first need to clone the Github repository of Ansiweather.

git clone https://github.com/fcambus/ansiweather.git

If Git is not installed on your device, you can install it using the following:

sudo apt update
sudo apt install git

Inside the cloned repository, invoke the Ansiweather script in this fashion:

./ansiweather

To display the forecast using metric units for the next five days (showing symbols and daylight data) for Delhi, India, the query string should look like this:

ansiweather -l "Delhi,IN" -u metric -s true -f 5 -d true

In the above command:

  • -u represents the unit system.
  • -s is a boolean that toggles to display symbols.
  • -f shows how many days the result should be
  • -d is a boolean that toggles the daylight data on or off.

Some other CLI apps you may want to check out are:

Desktop Weather Widgets

There are some desktop widgets in Linux that will display weather information directly in your workspace. These are very customizable and work with Conky.

1. Flair Weather

Flair Weather is a beautiful Conky widget made for Conky manager.

Weather 7

To install this tool, you’ll first need to install Conky manager in you desktop.

sudo add-apt-repository -y ppa:teejee2008/ppa
sudo apt-get update
sudo apt-get install conky-manager curl

Download Flair Weather from the deviantart website. Extract the downloaded folder and extract it to the .conkey folder present inside your home folder.

Go to Yahoo Weather and select your location. Copy your location ID from the URL to use in your Conky manager.

Inside the Conky manager, edit the location ID in Flair Weather and replace it with your ID from the previous step. Proceed to customize Conky as you normally would.

2. Elegent Weather

Weather Elegent

This is a very simple and minimal weather Conky widget. Unlike the previous one, this one depends on OpenWeatherMap API to display weather.

To install this widget, first install the dependencies:

sudo apt install conky curl jq

Go to the OpenWeatherMap website and get a free API key, then search for your location and copy the location ID, which is the last part of the URL after the city/ string.

Clone the GitHub repository and add your city ID and the free API key inside the “scripts.weather.sh” folder.

api_key=<YOUR_API_KEY>
city_id=<YOUR_CITY_ID>

You can now use this Conky on your desktop.

Frequently Asked Questions

Why I am unable to install Gnome extensions from the official website?

It may be because you are using the snap or flatpack version of the browser. These versions lack desktop integration, so you won’t be able to install Gnome extensions through that snap or flatpak browsers, but you can use the Extension Manager to install the extensions.

Is OpenWeather API free?

With the free plan, OpenWeather API provides a quota of 60 calls per minute, as well as weather forecasting, air quality index, geocoding API, etc. This is a decent offering for personal use. If you want to make a commercial offering, you’ll have to switch to a paid plan.

Image credit: Lucy Chian via Unsplash All screenshots by Hrishikesh Pathak

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Hrishikesh Pathak

Developer and writer. Write about linux and web.