Skip to content

Instantly share code, notes, and snippets.

@okitavera
Last active February 19, 2021 10:08
Show Gist options
  • Save okitavera/b0d88911628291d3c2d3217e4eaddf6a to your computer and use it in GitHub Desktop.
Save okitavera/b0d88911628291d3c2d3217e4eaddf6a to your computer and use it in GitHub Desktop.
wttr.in example with dzen2 and polybar module
#!/usr/bin/env bash
# width of window
W=250
# City
C=Malang
prin_weather() {
printf '\n\n %s Now \n\n' $C
curl -s "wttr.in/$C?0QT"
printf '\n'
}
eval $(xdotool getdisplaygeometry --shell)
prin_weather | dzen2 -p -l 9 \
-w $W -x $((WIDTH/2-W/2)) -y 18 \
-fn 'Fira Code:bold:size=8' \
-e 'onstart=hide,togglecollapse;button1=exit;button3=exit'
[module/weather]
type = custom/text
content = "view weather"
click-left = sh ~/.config/polybar/dzen2-wttr.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment