From 3a129c99a6ea0187377deebe340568147efc444e Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Sun, 2 Jan 2022 22:39:50 +0330 Subject: using good ole wttr.in --- tmux/date.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tmux') diff --git a/tmux/date.sh b/tmux/date.sh index c272d07..057108c 100755 --- a/tmux/date.sh +++ b/tmux/date.sh @@ -5,6 +5,7 @@ SEPARATOR_LEFT_BOLD="" SEPARATOR_LEFT_THIN="" RESULT=$(date +"%a %D %H:%M") +PROXY="proxychains4 -f /home/devi/proxies/ca/proxychains.conf" DAY="#[fg=colour255 bg=colour31]"$(echo $RESULT | gawk '{print $1}') DATE="#[fg=colour255 bg=colour31]"$(echo $RESULT | gawk '{print $2}') @@ -14,7 +15,8 @@ UTC_TIME="#[fg=colour255 bg=colour25]"$(echo GMT: $UTC_TIME_RESULT) # JDATE="#[fg=colour255 bg=colour29]"$(jdate | gawk '{print $2" "$3}') JDATE="#[fg=colour255 bg=colour29]"$(jdate | gawk '{print $2" "$3}') OPENWEATHERMAP_TOKEN=$(cat /home/devi/scripts/tmux/openweathermap.json|jq -r ".token") -WEATHER_INFO=$(sleep 120 && curl "https://api.openweathermap.org/data/2.5/weather?q=Tehran&appid=$OPENWEATHERMAP_TOKEN&units=metric"|jq ".main.temp") -WEATHER="#[fg=colour255 bg=colour32]"$(echo $WEATHER_INFO" C") +# WEATHER_INFO=$(sleep 120 && torsocks curl "https://api.openweathermap.org/data/2.5/weather?q=Tehran&appid=$OPENWEATHERMAP_TOKEN&units=metric"|jq ".main.temp") +WEATHER_INFO=$(curl 'wttr.in/tehran?T&format=%t/%f') +WEATHER="#[fg=colour255 bg=colour32]"$(echo $WEATHER_INFO) echo "#[fg=colour32 bg=colour16]$SEPARATOR_LEFT_BOLD$WEATHER#[fg=colour29 bg=colour32]$SEPARATOR_LEFT_BOLD$JDATE #[fg=colour31 bg=colour29]$SEPARATOR_LEFT_BOLD$DAY $SEPARATOR_LEFT_THIN $DATE $SEPARATOR_LEFT_THIN $TIME #[fg=colour25 bg=colour31]$SEPARATOR_LEFT_BOLD$UTC_TIME " -- cgit v1.2.3