From 5bd9cdf6e45da7a9d22d9aedeb3ecd9fdce33bf0 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Mon, 26 Apr 2021 01:57:12 +0200 Subject: waybar/covid: show history in tooltip --- .config/waybar/modules/covid.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to '.config') diff --git a/.config/waybar/modules/covid.sh b/.config/waybar/modules/covid.sh index d8f59a4..558c2c5 100755 --- a/.config/waybar/modules/covid.sh +++ b/.config/waybar/modules/covid.sh @@ -13,7 +13,7 @@ done # incidence = (sumCasesLast7Days / EWZ) * 100000 lat=${HOME_LAT:?} -lon=${HOME_LAT:?} +lon=${HOME_LON:?} fields='GEN,RS,EWZ,EWZ_BL,BL_ID,cases,cases_per_100k,cases7_per_100k,cases7_bl_per_100k,last_update,BL,IBZ' # see https://experience.arcgis.com/experience/478220a4c454480e823b17327b2bf1d4 uri="https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=${fields}&geometry=${lon}%2C${lat}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json" @@ -66,6 +66,13 @@ if [ "${incidence_i}" -gt "250" ]; then color='darkdarkred' fi +tooltip=" +7 Tage Inzidenz für ${loc} +last update: ${last_update} + +history (${trend_arrow}): +$(awk -F, '{print $1 " " $2}' ${HISTFILE} | head -n10) +" + jq -nr \ - "{ text: \"${trend_arrow}${incidence_f}\", percentage: \"${incidence_i}\", class: \"${color}\", alt: \"${color}\", - tooltip: \"7 Tage Inzidenz für \\n${loc}\\nLast update: ${last_update}\" } | @text" + "{ text: \"${trend_arrow}${incidence_f}\", percentage: \"${incidence_i}\", class: \"${color}\", alt: \"${color}\", tooltip: \"${tooltip}\" } | @text" -- cgit 1.4.1