Skip to content

Instantly share code, notes, and snippets.

@davidsharp
Last active Jul 10, 2020
Embed
What would you like to do?
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