Update 0010_300_weather

This commit is contained in:
BitHeaven 2023-03-08 17:06:00 +05:00 committed by GitHub
parent db2199c05b
commit abd5b97495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -1,12 +1,17 @@
#!/bin/bash #!/bin/bash
CITY="Tyumen" CITY="auto"
COLOR1="#AAAAAA" COLOR1="#AAAAAA"
COLOR2="#444444" 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 ' ') icon=$(echo $icon | tr -d ' ')
temp=$(curl -s "wttr.in/$CITY?format=%t") 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") 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^"