Last active
July 10, 2020 08:53
-
-
Save davidsharp/b57d34dba2124bc8d440a60699b82a4a to your computer and use it in GitHub Desktop.
bitbar plugin for wttr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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