ansiweather

Weather in terminal, with ANSI colors and Unicode symbols
Log | Files | Refs | README | LICENSE

commit 204c755029bed9446b6b8398535aa65ce5879498
parent b19e9bcccc2b0b7c041f69a4f145bcabaf7bd1c4
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Fri, 17 Jan 2014 11:40:00 -0800

Merge pull request #47 from thirota/symbols-forecast

Adding feature to hide symbols in forecast mode
Diffstat:
Mansiweather | 18+++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/ansiweather b/ansiweather @@ -327,14 +327,6 @@ function get_icon { esac } -if [ $symbols = true ] -then - if [ $forecast = 0 ] - then - icon="$(get_icon $sky)" - fi -fi - ###[ Display current Weather ]################################################# @@ -344,7 +336,11 @@ then output="$background$text $city forecast $text$delimiter " for i in $(seq 0 $(($forecast-1))) do - icon="$(get_icon ${sky[$i]})" + icon="" + if [ $symbols = true ] + then + icon="$(get_icon ${sky[$i]})" + fi output="$output$text${dates[$i]}: $data${highs[$i]}$text/$data${lows[$i]} $scale $icon" if [ $i -lt $(($forecast-1)) ] then @@ -354,6 +350,10 @@ then output="$output\033[0m" echo -e "$output" else + if [ $symbols = true ] + then + icon="$(get_icon $sky)" + fi output="$background$text $greeting_text $city $delimiter$data $temperature $scale $icon$dashes$text $wind_text $delimiter$data $wind $speed_unit $direction $dashes$text $humidity_text $delimiter$data $humidity % $dashes$text $pressure_text $delimiter$data $pressure $pressure_unit" if [ $daylight = true ]