Weatherbar is a custom-module for Waybar to see weather information.
See the manual page of Waybar custom-module(5) for more information about custom-module.
git clone https://github.com/ownesis/weatherbar
cd weatherbar
mkdir build && cd build/
cmake .. && make
sudo cp weatherbar /usr/local/bin/
The customization/configuration of weatherbar is almost the same of Waybar.
The configuration is done with a json file and you can use the same format of Waybar {like_this}
for replace a format by a specific value.
The configuration file have 4
keys:
"text"
: String value, is the format to print in your bar (seeformat
inwaybar-custom(5) man page
)"tooltip"
: String value, is the format for tooltip (when your mouse hover the module (seetooltip
in waybar-custom(5) man page)"weather"
: Dictionnary, This key have more key/value options related to the possible weather condition. (see example_config.json); A condition have two keys:"icon"
: String value, It's the icon for this weather condition."text"
: Srtring value, It's a custom text/information about this weather condition.
"city"
: String value, It's the city to use for get weather. The value can be""
for use the city found with your IP address.
{city}
: The city.{counry}
: The country.{latitude}
: The latitude.{longitude}
: The longitude.{elevation}
: The altitude.{sunrise}
: The Sunrise.{sunset}
: The Sunset.{date}
: The date of the weather forecast.{hour}
: The hour of the weather forecast.{wind_speed}
: The speed of the wind.{wind_dir}
: The direction of the wind: (N, O, E, S, NO, NE, SE, SO) O == W(est).{wind_gust}
: The wind gust.{condition}
: The "friendly readable" weather condition (in French).{condition_key}
: The key of the weather condition (in French).{temp}
: The temperature in Celcius.{humidity}
: The percentage of humidity.{pressure}
: The pressure in hPa.{weather.icon}
: The Icon of the actual weather condition. (see Customization/Configuration).{weather.text}
: The custom test of the actual weather condition (see Customization/Configuration).
Add this "block" in your Waybar configuration file:
"custom/weather": {
"format": "{}",
"return-type": "json",
"exec": "weatherbar /path/to/weatherbar_conf.json",
"interval": 1800
},
Don't forget to add custom/meteo
inside the array "module-right", "module-center" or "module-left" into the waybar configuration and to add a css class inside style.css
, the name of the CSS class is "custom-weather" (for our example above).