Added -n and -p switches and docs for both

pull/2/head
Steven Saus 4 years ago
parent 9badc6b4bf
commit dd70b92ec9
  1. 2
      README.md
  2. 2
      docs/README.md
  3. 12
      forecast.sh
  4. 21
      weather.sh

@ -87,6 +87,8 @@ options:
* `-h` Output HTML formatted text
* `-o` Output OpenBox output
* `-y` Output Conky format (no icons)
* `-n` Terminal output without icons
* `-p` Specify cache/temp path *with* trailing slash
* `-f` Use imperial (farenheit, inches Hg, mph) units; default is metric
* `-c` Use colored output in the terminal if `.bashcolors` is in the home
dir. Note that if you want to alter the colors, you will have to manually

@ -87,6 +87,8 @@ options:
* `-h` Output HTML formatted text
* `-o` Output OpenBox output
* `-y` Output Conky format (no icons)
* `-n` Terminal output without icons
* `-p` Specify cache/temp path *with* trailing slash
* `-f` Use imperial (farenheit, inches Hg, mph) units; default is metric
* `-c` Use colored output in the terminal if `.bashcolors` is in the home
dir. Note that if you want to alter the colors, you will have to manually

@ -69,6 +69,11 @@ option="$1"
shift ;;
-f) degreeCharacter="f"
shift ;;
-n) UseIcons="False"
shift ;;
-p) CachePath="$2"
shift
shift ;;
-c)
if [ -f "$HOME/.bashcolors" ];then
source "$HOME/.bashcolors"
@ -94,7 +99,12 @@ esac
# Do we need a new datafile? If so, get it.
########################################################################
dataPath="/tmp/fore-$defaultLocation.json"
if [ -z "${CachePath}" ];then
dataPath="/tmp/fore-$defaultLocation.json"
else
dataPath="${CachePath}fore-$defaultLocation.json"
fi
if [ ! -e $dataPath ];then
touch $dataPath
if [ "$CityID" = "True" ];then

@ -58,6 +58,11 @@ option="$1"
shift ;;
-f) degreeCharacter="f"
shift ;;
-p) CachePath="$2"
shift
shift ;;
-n) UseIcons="False"
shift ;;
-c)
if [ -f "$HOME/.bashcolors" ];then
source "$HOME/.bashcolors"
@ -67,6 +72,12 @@ option="$1"
esac
done
if [ -z "${CachePath}" ];then
dataPath="/tmp/wth-$defaultLocation.json"
else
dataPath="${CachePath}wth-$defaultLocation.json"
fi
if [ -z $apiKey ];then
echo "No API Key specified in rc, script, or command line."
exit
@ -78,8 +89,6 @@ case $defaultLocation in
*) CityID="True" ;;
esac
dataPath="/tmp/wth-$defaultLocation.json"
if [ ! -e $dataPath ];
then
touch $dataPath
@ -240,8 +249,12 @@ while true; do
if [ "$FeelsLike" = "1" ];then
echo "Feels Like: ${RED}$FeelsLikeTemp°${degreeCharacter^^}${RESTORE}"
fi
echo "Pressure: ${GREEN}$pressure$pressureunit${MAGENTA}"
echo -e \\u$winddir "$WindSpeed$windunit${RESTORE} Gusts: ${MAGENTA}$WindGusts$windunit${RESTORE}"
echo "Pressure: ${GREEN}$pressure$pressureunit${RESTORE}"
if [ "$UseIcons" = "True" ];then
echo -e \\u$winddir "${MAGENTA}$WindSpeed$windunit${RESTORE} Gusts: ${MAGENTA}$WindGusts$windunit${RESTORE}"
else
echo "Wind: ${MAGENTA}$WindSpeed$windunit${RESTORE} Gusts: ${MAGENTA}$WindGusts$windunit${RESTORE}"
fi
echo "Humidity: ${GREEN}$Humidity%${RESTORE}"
echo "Cloud Cover: ${GREEN}$CloudCover%${RESTORE}"
else

Loading…
Cancel
Save