Don't get decimal point of weather

This commit is contained in:
Alex 2020-06-13 22:12:45 +02:00
parent f0afa5341f
commit 4a79f8ab3e
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
1 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ function prompt_c_covid_19() {
}
function cprompts:cache:async:covid() {
typeset -g _cprompts_covid=$(curl -sL https://api.covid19api.com/country/${REPLY:-germany} | jq -e '. |= sort_by (.Date) | .[-1].Active')
[ ! -z $_cprompts_covid ] && print $_cprompts_covid > $tmpfile
[ ! -z $_cprompts_covid ] && print ${_cprompts_covid} > $tmpfile
}
function prompt_c_weather() {
local tmpfile=${CACHEPATH}/weather
@ -82,7 +82,7 @@ function cprompts:cache:async:weather() {
if [ ! -z $result ]; then
local ico=$(print $result | jq -r '.icon')
typeset -g _cprompts_weather=($(print $result | jq -r '.temp') ${colors[$ico]} ${icons[$ico]:-?})
print $_cprompts_weather > $tmpfile
print ${_cprompts_weather%%.*} > $tmpfile
fi
}