From 8d04c30392025c0a59025ea9ab3ee325c08b2888 Mon Sep 17 00:00:00 2001 From: Conner McCall Date: Tue, 9 Jun 2020 14:30:35 -0500 Subject: [PATCH] adding a wttr.in alias/function --- .bash_profile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.bash_profile b/.bash_profile index 6c94aba..9152291 100644 --- a/.bash_profile +++ b/.bash_profile @@ -15,3 +15,11 @@ HISTFILESIZE=15000 test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash" +wttr() +{ + # change Paris to your default location + local request="wttr.in/${1-St+Paul+MN}" + [ "$(tput cols)" -lt 125 ] && request+='?n' + curl -H "Accept-Language: ${LANG%_*}" --compressed "$request" +} +