ansiweather

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

commit 52e720fa65e764267de2d0211426ad83343b2400
parent 0c4da1a0df0ab6ed136413e5024a0163d2122a54
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Fri,  8 May 2015 22:29:08 +0200

Merge pull request #61 from lucc/config

Add environment variable to set rc file location
Diffstat:
MREADME.md | 10+++++-----
Mansiweather | 10+++++-----
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md @@ -11,7 +11,7 @@ Weather data comes from the `OpenWeatherMap` free weather API. ## Requirements -AnsiWeather requires the following dependencies : +AnsiWeather requires the following dependencies : - A command to fetch HTTP data such as [cURL](http://curl.haxx.se) or [wget](https://www.gnu.org/software/wget/) - [jq](http://stedolan.github.io/jq/) (lightweight and flexible command-line JSON processor) @@ -37,10 +37,10 @@ Any configuration options may also be passed in as command line options : ## Configuration -The following configuration options (detailed below) are available and should -be set according to your location and preferences. - -Config options can also be set in ~/.ansiweatherrc : +The default config file is ~/.ansiweatherrc. The environment varibale +ANSIWEATHERRC can be set to overwrite this. The following configuration options +(detailed below) are available and should be set according to your location and +preferences. Example : `~/.ansiweatherrc` diff --git a/ansiweather b/ansiweather @@ -19,13 +19,13 @@ LC_NUMERIC=C -config_file=~/.ansiweatherrc +config_file=${ANSIWEATHERRC:-~/.ansiweatherrc} function get_config { ret="" if [ -f $config_file ] then - ret=$(grep "^$1:" $config_file | awk -F: '{print $2}') + ret=$(grep "^$1:" $config_file | awk -F: '{print $2}') fi if [ "X$ret" = "X" ] @@ -44,10 +44,10 @@ fetch_cmd=$(get_config "fetch_cmd" || echo "curl -s") jqpath="`which jq`" if [ "$jqpath" == "" ] -then +then echo -e "\njq binary is not found, please download it from http://stedolan.github.io/jq/ and put it in your PATH" exit 255 -fi +fi @@ -341,7 +341,7 @@ function get_icon { if [ $forecast != 0 ] then output="$background$text $city forecast $text$delimiter " - + i=0 while [ $i -lt $forecast ] do