ansiweather

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

commit fd4a933b161318c2d4a21d418dd7fdc7b9d19ada
parent b19e9bcccc2b0b7c041f69a4f145bcabaf7bd1c4
Author: Takayuki Hirota <thirota73@gmail.com>
Date:   Mon, 13 Jan 2014 13:56:00 +0900

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 ]