From abd5b974955e47958b40daecbb8262e4a3a718b7 Mon Sep 17 00:00:00 2001 From: BitHeaven <33015545+BitHeaven-Official@users.noreply.github.com> Date: Wed, 8 Mar 2023 17:06:00 +0500 Subject: [PATCH] Update 0010_300_weather --- .local/scripts/bbr/0010_300_weather | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.local/scripts/bbr/0010_300_weather b/.local/scripts/bbr/0010_300_weather index f597fca..f89923e 100755 --- a/.local/scripts/bbr/0010_300_weather +++ b/.local/scripts/bbr/0010_300_weather @@ -1,12 +1,17 @@ #!/bin/bash -CITY="Tyumen" +CITY="auto" COLOR1="#AAAAAA" COLOR2="#444444" -icon=$(curl -s "wttr.in/$CITY?format=%c") +if[$CITY = 'auto'] +then + CITY="@$(curl zx2c4.com/ip | head -1)" +fi + +icon=$(curl -s "wttr.in/$CITY?format=%C") icon=$(echo $icon | tr -d ' ') temp=$(curl -s "wttr.in/$CITY?format=%t") @@ -14,4 +19,4 @@ temp=$(curl -s "wttr.in/$CITY?format=%t") wind=$(curl -s "wttr.in/$CITY?format=%w") -echo "^b$COLOR2^^c$COLOR1^ $wind ^b$COLOR1^^c$COLOR2^ $icon ^c$COLOR1^^b$COLOR2^ $temp ^d^" +echo "^b$COLOR2^^c$COLOR1^ ^b$COLOR1^^c$COLOR2^ $icon ^c$COLOR1^^b$COLOR2^ $temp ^d^"