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/sh | |
if [ "$1" == "" ]; then | |
if [ -f ~/.wttrrc ]; then | |
curl `echo -n "https://wttr.in/";head -n 1 ~/.wttrrc | tr -d "\n";echo -n "?";head -n 2 ~/.wttrrc | tail -n 1 | tr -d "\n";echo -n "&format=";tail -n 1 ~/.wttrrc | tr -d "\n"` | |
elif [ -f ~/.config/wttrrc ]; then | |
curl `echo -n "https://wttr.in/";head -n 1 ~/.config/wttrrc | tr -d "\n";echo -n "?";head -n 2 ~/.config/wttrrc | tail -n 1 | tr -d "\n";echo -n "&format=";tail -n 1 ~/.config/wttrrc | tr -d "\n"` | |
else | |
echo "If you are to use weather without a .wttrrc in your ~ (or without a ~/.config/wttrrc), please refer to the '--help' flag for creating a .wttrrc." | |
fi |