Skip to content

Instantly share code, notes, and snippets.

@davidsharp
Last active July 10, 2020 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidsharp/b57d34dba2124bc8d440a60699b82a4a to your computer and use it in GitHub Desktop.
Save davidsharp/b57d34dba2124bc8d440a60699b82a4a to your computer and use it in GitHub Desktop.
bitbar plugin for wttr
#!/bin/bash
function wttr(){
if [ -z "$2" ]
then
curl -sf "wttr.in/$1?0"
else
curl -sf "wttr.in/$1?$2"
fi
}
location="Brighton and Hove"
esc_location=${location// /%20}
wttr $esc_location format='%c+%t+%w'
echo ""
echo "---"
echo "Weather for $location"
echo "Powered by wttr.in|href=http://wttr.in/$esc_location"
echo "Retrieved at $(date +%H:%M)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment