Configuration file for dwm-bar on macbook air
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
551 B

  1. #!/bin/sh
  2. # A dwm_bar function to print the weather from wttr.in
  3. # Joe Standring <git@joestandring.com>
  4. # GNU GPLv3
  5. # Dependencies: curl
  6. # Change the value of LOCATION to match your city
  7. dwm_weather() {
  8. LOCATION=London
  9. if [ "$IDENTIFIER" = "unicode" ]; then
  10. DATA=$(curl -s wttr.in/$LOCATION?format=1)
  11. export __DWM_BAR_WEATHER__="${SEP1} ${DATA} ${SEP2}"
  12. else
  13. DATA=$(curl -s wttr.in/$LOCATION?format=1 | grep -o ".[0-9].*")
  14. export __DWM_BAR_WEATHER__="${SEP1} WEA ${DATA} ${SEP2}"
  15. fi
  16. }
  17. dwm_weather