From d76de1b4a28e468fec17bff03fcd03f54fe38ced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E5=92=8C=E3=81=A7=E3=81=AA=E3=82=8A?= Date: Thu, 3 May 2018 17:10:42 +0800 Subject: [PATCH] Added location variable Manually put location by suffixing it to the wttr.in link --- .scripts/i3weather | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.scripts/i3weather b/.scripts/i3weather index 2464795..d5112cc 100755 --- a/.scripts/i3weather +++ b/.scripts/i3weather @@ -4,7 +4,11 @@ ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` >/dev/null || exit -curl wttr.in > ~/.weatherreport +### This is only if your location isn't automatically detected, otherwise you can leave it blank. +loc="" +location=${loc// /+} + +curl wttr.in/~$location > ~/.weatherreport echo -n ☔ $(cat ~/.weatherreport | sed -n 16p | sed -e 's/[^m]*m//g' | grep -o "[0-9]*%" | sort -n | sed -e '$!d')