Clean up README;silence CURL

pull/2/head 0.9.9
Steven Saus 4 years ago
parent 6ac57b0d30
commit 14a3e30d57
  1. 11
      README.md
  2. 34
      forecast.sh
  3. 22
      weather.sh

@ -70,12 +70,11 @@ chill, it is not displayed.
### weather_sh.rc
Copy (and edit, as appropriate) the `weather_sh.rc` file to `$HOME\.config`.
The first line is the OpenWeatherMap API key
The second line is your default location. (See note below)
The third line is your default degree character (either `c` or `f`)
The fourth line is True or False depending on whether or not you want
icons displayed for the weather.
Copy (and edit, as appropriate) the `weather_sh.rc` file to `$HOME\.config\weather_sh.rc`.
* The first line is the OpenWeatherMap API key
* The second line is your default location. (See note below)
* The third line is your default degree character (either `c` or `f`)
* The fourth line is True or False depending on whether or not you want icons displayed for the weather.
### Command-line options

@ -201,17 +201,29 @@ while true; do
fi
fi
if [ "$Conky" = "True" ]; then
let i=0
bob=""
while [ $i -lt 5 ]; do
CastDate=$(date +"%s" -d @${NixDate[$i]})
if [ $CastDate -le $TomorrowDate ]; then
ShortDate=$(date +"%R" -d @${NixDate[$i]})
bob=$(printf "%s %-4s%-2s %-4s " "$bob" "$ShortDate:" "${ShortWeather[$i]}" "${temperature[$i]}°${degreeCharacter^^}")
fi
i=$((i + 1))
done
if [ "$colors" = "True" ]; then
let i=0
bob=""
while [ $i -lt 5 ]; do
CastDate=$(date +"%s" -d @${NixDate[$i]})
if [ $CastDate -le $TomorrowDate ]; then
ShortDate=$(date +"%R" -d @${NixDate[$i]})
bob=$(printf "%s %-4s%-2s %-4s |" "$bob" "$ShortDate:" "${ShortWeather[$i]}" "${temperature[$i]}°${degreeCharacter^^}")
fi
i=$((i + 1))
done
else
let i=0
bob=""
while [ $i -lt 5 ]; do
CastDate=$(date +"%s" -d @${NixDate[$i]})
if [ $CastDate -le $TomorrowDate ]; then
ShortDate=$(date +"%R" -d @${NixDate[$i]})
bob=$(printf "%s %-5s %-6s %-4s |" "$bob" "$ShortDate:" "${ShortWeather[$i]}" "${temperature[$i]}°${degreeCharacter^^}")
fi
i=$((i + 1))
done
fi
#bob=$(echo "$icon $ShortWeather $temperature°${degreeCharacter^^}")
#bob

@ -85,9 +85,9 @@ then
touch $dataPath
#The API call is different if city ID is used instead of string lookup
if [ "$CityID" = "True" ];then
data=$(curl "http://api.openweathermap.org/data/2.5/weather?id=$defaultLocation&units=metric&appid=$apiKey")
data=$(curl "http://api.openweathermap.org/data/2.5/weather?id=$defaultLocation&units=metric&appid=$apiKey" -s )
else
data=$(curl "http://api.openweathermap.org/data/2.5/weather?q=$defaultLocation&units=metric&appid=$apiKey")
data=$(curl "http://api.openweathermap.org/data/2.5/weather?q=$defaultLocation&units=metric&appid=$apiKey" -s )
fi
echo $data > $dataPath
else
@ -99,9 +99,9 @@ while true; do
lastfileupdate=$(date -r $dataPath +%s)
if [ $(($(date +%s)-$lastfileupdate)) -ge 600 ];then
if [ "$CityID" = "True" ];then
data=$(curl "http://api.openweathermap.org/data/2.5/weather?id=$defaultLocation&units=metric&appid=$apiKey")
data=$(curl "http://api.openweathermap.org/data/2.5/weather?id=$defaultLocation&units=metric&appid=$apiKey" -s )
else
data=$(curl "http://api.openweathermap.org/data/2.5/weather?q=$defaultLocation&units=metric&appid=$apiKey")
data=$(curl "http://api.openweathermap.org/data/2.5/weather?q=$defaultLocation&units=metric&appid=$apiKey" -s )
fi
echo $data > $dataPath
fi
@ -260,9 +260,17 @@ while true; do
fi
fi
if [ "$Conky" = "True" ]; then
bob=$(echo "$ShortWeather $temperature°${degreeCharacter^^}")
if [ "$FeelsLike" = "1" ];then
bob=$(echo "$bob/$FeelsLikeTemp°${degreeCharacter^^}")
if [ "$colors" = "True" ]; then
bob=$(echo "$ShortWeather $temperature°${degreeCharacter^^}")
if [ "$FeelsLike" = "1" ];then
bob=$(echo "$bob/$FeelsLikeTemp°${degreeCharacter^^}")
fi
else
bob=$(echo "$ShortWeather $temperature°${degreeCharacter^^}")
if [ "$FeelsLike" = "1" ];then
bob=$(echo "$bob/$FeelsLikeTemp°${degreeCharacter^^}")
fi
fi
echo "$bob"
fi

Loading…
Cancel
Save