polybar: Add weather script
Added script to show the forecast weather for the immediate future / right now in polybar.
This commit is contained in:
parent
18cd15222d
commit
5d265a33f7
2 changed files with 35 additions and 1 deletions
23
polybar/.config/polybar/scripts/poly-weather
Executable file
23
polybar/.config/polybar/scripts/poly-weather
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
wttr() {
|
||||
# change Paris to your default location
|
||||
request="wttr.in/${1-~Leipzig}"
|
||||
curl -s -H "Accept-Language: ${LANG%_*}" --compressed "$request"
|
||||
}
|
||||
|
||||
wttr "$@"
|
||||
|
||||
# while true; do
|
||||
# all="$(bib-due -u 'fri this week' -p3 | wc -l)"
|
||||
# required="$(bib-due -u 'fri this week' -p1 | wc -l)"
|
||||
|
||||
# # add polybar formatting to color required readings red
|
||||
# # https://github.com/polybar/polybar/wiki/Formatting#format-tags
|
||||
# # TODO use xresources
|
||||
# colorreq=$(xrdb -query | grep -e '\*color1:' | cut -f2)
|
||||
# colorall=$(xrdb -query | grep -e '\*foreground:' | cut -f2)
|
||||
# printf "%s%s%s(%s)\n" "%{F${colorall:-#000}}" "$all" "%{F${colorreq:-#d00}}" "$required"
|
||||
|
||||
# sleep 120
|
||||
# done
|
||||
Loading…
Add table
Add a link
Reference in a new issue