From c34c07fa91de0085173ff2faa0699787c91cc272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Thu, 7 Apr 2022 22:33:40 +0100 Subject: [PATCH] more descriptive weather --- nixos/i3/openweathermap-fullfeatured.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nixos/i3/openweathermap-fullfeatured.sh b/nixos/i3/openweathermap-fullfeatured.sh index 383eddc1..4e608c93 100755 --- a/nixos/i3/openweathermap-fullfeatured.sh +++ b/nixos/i3/openweathermap-fullfeatured.sh @@ -78,6 +78,7 @@ if [ -n "$current" ] && [ -n "$forecast" ]; then current_temp=$(echo "$current" | $JQ ".main.temp" | $CUT -d "." -f 1) current_feels=$(echo "$current" | $JQ ".main.feels_like" | $CUT -d "." -f 1) current_icon=$(echo "$current" | $JQ -r ".weather[0].icon") + current_text=$(echo "$current" | $JQ -r ".weather[0].description") forecast_temp=$(echo "$forecast" | $JQ ".list[].main.temp" | $CUT -d "." -f 1) forecast_feels=$(echo "$forecast" | $JQ ".list[].main.feels_like" | $CUT -d "." -f 1) @@ -85,12 +86,12 @@ if [ -n "$current" ] && [ -n "$forecast" ]; then if [ "$current_temp" -gt "$forecast_temp" ]; then - trend="" + trend="getting colder" elif [ "$forecast_temp" -gt "$current_temp" ]; then - trend="" + trend="getting warmer" else - trend="" + trend="stable weather" fi - echo "$(get_icon "$current_icon") $current_temp($current_feels)$SYMBOL $trend $(get_icon "$forecast_icon") $forecast_temp($forecast_feels)$SYMBOL" + echo "now $(get_icon "$current_icon") $current_text $current_temp($current_feels)$SYMBOL, $trend, later $(get_icon "$forecast_icon") $forecast_temp($forecast_feels)$SYMBOL" fi