Skip to content

Simple weather script for bash using wttr.in, designed for use with polybar.

License

Notifications You must be signed in to change notification settings

k3ssdev/weather_bash_script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

Weather Polybar Script

This script obtains weather information from wttr.in and displays it in the format icon condition temperature humidity.

Dependencies

  • curl: required to retrieve weather information from wttr.in.

Usage

  1. Place the script in a convenient location, such as ~/.config/bspwm/polybar/scripts/weather-bar.sh.
  2. Make the script executable: chmod +x ~/.config/bspwm/polybar/scripts/weather-bar.sh.
  3. Add a new module to your Polybar configuration file config:
[module/weather]
type = custom/script
interval = 900
exec = ~/.config/bspwm/polybar/scripts/weather-bar.sh

format = <label>
label = %output%

label-foreground = ${color.GREEN}
label-background = ${color.BACKGROUND}
label-padding = 2

format-foreground = ${color.GREEN}
format-background = ${color.BACKGROUND}
label-font = 1
  1. Restart your Polybar to see the weather information.

Customization

  • label-font: controls the font size of the label.

To use different icons, modify the case statement in the script to assign the appropriate Unicode value to the icon variable for each weather condition. You can find the Unicode values for icons in the Unicode character table.

To use a different weather API or modify the information displayed, modify the curl request in the script accordingly.

Screenshot

image

Acknowledgments

This script uses weather information from wttr.in. We are grateful for the developers and contributors to this fantastic project.

About

Simple weather script for bash using wttr.in, designed for use with polybar.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages