From c492d0a7183d29fe528e8de17da4c1ca6e78c152 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Wed, 20 Jul 2022 17:26:41 +0200 Subject: [PATCH] Update meteo function --- zshrc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 682a031..958b64c 100644 --- a/zshrc +++ b/zshrc @@ -1101,7 +1101,15 @@ function debcplay() { # }}} # Web apps {{{ # Get weather -alias meteo="curl http://fr.wttr.in/" +function meteo { + if command -v curl > /dev/null; then + curl http://fr.wttr.in/${*} + elif command -v wget > /dev/null; then + wget -qO- http://wttr.in/${*} + else + printf '%b' "Please ${REDB}install one of this tools :${RESET} curl or wget.\n" + fi +} # }}} #######################################