mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 10:05:13 -05:00
feat: restructured some stuff for user1
This commit is contained in:
parent
8e918f915c
commit
cfdf20a39c
76 changed files with 233 additions and 99 deletions
19
profiles/user0/files/get_weather.sh
Executable file
19
profiles/user0/files/get_weather.sh
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
for i in {1..5}
|
||||
do
|
||||
text=$(curl -s "https://wttr.in/$1?format=1")
|
||||
if [[ $? == 0 ]]
|
||||
then
|
||||
text=$(echo "$text" | sed -E "s/\s+/ /g")
|
||||
tooltip=$(curl -s "https://wttr.in/$1?format=4")
|
||||
if [[ $? == 0 ]]
|
||||
then
|
||||
tooltip=$(echo "$tooltip" | sed -E "s/\s+/ /g")
|
||||
echo "{\"text\":\"$text\", \"tooltip\":\"$tooltip\"}"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
echo "{\"text\":\"error\", \"tooltip\":\"error\"}"
|
Loading…
Add table
Add a link
Reference in a new issue