Compare commits

..

No commits in common. "37ca6c1f5c314f6820bcf88d1db7096c32c8ed41" and "b01add300cdbfda6bf95abb862ea81d3086ee0a3" have entirely different histories.

2 changed files with 11 additions and 21 deletions

View file

@ -1,3 +0,0 @@
if command -v direnv &> /dev/null; then
eval "$(direnv hook zsh)"
fi

View file

@ -35,7 +35,7 @@ function weather_short_status() {
WEATHER_LOCATION_KEY="$(< "${HOME_LOCATION_KEY_PATH}")"
_weather_current_conditions | jq -er "$(<<'EOF'
_weather_current_conditions | jq -r "$(<<'EOF'
first |
[
"RF:"+(.RealFeelTemperature.Imperial.Value | tostring)+"°",
@ -49,7 +49,7 @@ first |
join(" ") |
rtrimstr(" ")
EOF
)" 2>/dev/null
)"
)
}
@ -151,22 +151,15 @@ function _weather_current_conditions() {
TEMP_OUTPUT="$(mktemp)"
trap 'rm -f "${TEMP_OUTPUT}"' EXIT
(
set +e
curl -LSsf \
--max-time "${WEATHER_CURL_TIMEOUT}" \
--get \
-X GET \
--data-urlencode "apikey=${WEATHER_API_KEY}" \
--data-urlencode "language=en-us" \
--data-urlencode "details=true" \
"https://dataservice.accuweather.com/currentconditions/v1/${WEATHER_LOCATION_KEY}" \
-o "${TEMP_OUTPUT}"
if [ $? -eq 28 ]; then
# timeout reached, just store empty data
echo '{}' > "${TEMP_OUTPUT}"
fi
)
curl -LSsf \
--max-time "${WEATHER_CURL_TIMEOUT}" \
--get \
-X GET \
--data-urlencode "apikey=${WEATHER_API_KEY}" \
--data-urlencode "language=en-us" \
--data-urlencode "details=true" \
"https://dataservice.accuweather.com/currentconditions/v1/${WEATHER_LOCATION_KEY}" \
-o "${TEMP_OUTPUT}"
mv -f "${TEMP_OUTPUT}" "${CURRENT_WEATHER_CACHE_FILE}"
> /dev/stdout < "${CURRENT_WEATHER_CACHE_FILE}"