diff --git a/custom/segments.zsh b/custom/segments.zsh index 6fbcf60..84bcf73 100644 --- a/custom/segments.zsh +++ b/custom/segments.zsh @@ -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 }