Don't get decimal point of weather
This commit is contained in:
parent
f0afa5341f
commit
4a79f8ab3e
|
@ -34,7 +34,7 @@ function prompt_c_covid_19() {
|
||||||
}
|
}
|
||||||
function cprompts:cache:async:covid() {
|
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')
|
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() {
|
function prompt_c_weather() {
|
||||||
local tmpfile=${CACHEPATH}/weather
|
local tmpfile=${CACHEPATH}/weather
|
||||||
|
@ -82,7 +82,7 @@ function cprompts:cache:async:weather() {
|
||||||
if [ ! -z $result ]; then
|
if [ ! -z $result ]; then
|
||||||
local ico=$(print $result | jq -r '.icon')
|
local ico=$(print $result | jq -r '.icon')
|
||||||
typeset -g _cprompts_weather=($(print $result | jq -r '.temp') ${colors[$ico]} ${icons[$ico]:-?})
|
typeset -g _cprompts_weather=($(print $result | jq -r '.temp') ${colors[$ico]} ${icons[$ico]:-?})
|
||||||
print $_cprompts_weather > $tmpfile
|
print ${_cprompts_weather%%.*} > $tmpfile
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue