Skip to content

A sweet and simple polybar module to get the weather. Written in bash.

Notifications You must be signed in to change notification settings

Strix007/polybar-getweather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

showcase

Weather Module For Polybar

Description

This Polybar plugin uses OpenWeather API to get and display information about the current weather like the temprate and condition. The temprature is shown in numericals while the condition is shown through color and icons.

This module is easily customizable. All you need to do is modify the shell script getweather.sh.

Table Of Contents

Dependencies

Installation

1 - Get your own openweather api key. If you don’t know how to, refer to this article.
2 - Get the city code of the city whose weather details you want. You can search your city on openweather.org and copying the digits after .../city/.
3 - Make a plain text file called .env in your home directory.
4 - Put the API key and city code in the text file. eg.

OPEN_WEATHER_API_KEY="yourAPIkey"
OPEN_WEATHER_CITY_ID="yourCityCode"

5 - Make the script executable by chmod + x /path/to/the/script
6 - Put this in your polybar config.ini

[module/weather]
type     = custom/script
exec     = /path/to/the/script
tail     = false
interval = 100

7 - Add the module to your bar’s modules.

Customization

Units

You can customize the units by changing the value of UNITS in the script. Possible values are metric, imperial and kelvin.

Icons

You can change the icons for the different weather conditions by changing the ICON variable in the script.

Colors

You can change the colors for the different weather conditions by changing the ICON_HEX variable in the script.

Conditions

You can change the conditions of the different icon codes by changing the values of the CONDITION and DAYTIME variables.

Contributing

If you want to add some features or want to fix a mistake, feel free to open a pull request.

About

A sweet and simple polybar module to get the weather. Written in bash.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages